GotoBookmark Error

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
hsk
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 29.11.2009, 05:22
Location: Rio de Janeiro

GotoBookmark Error

Post by hsk »

I dont know if this is the right place, but...

I tried to use the component JvDBTreeview of the Jedi Library (is simple to implement), and I got the exception below:

Code: Select all

procedure TZAbstractRODataset.InternalGotoBookmark(Bookmark: Pointer);
var
  Index: Integer;
begin
  Index := CurrentRows.IndexOf(Bookmark);

  if Index < 0 then
    [bcolor=#FF0000]raise EZDatabaseError.Create(SBookmarkWasNotFound);[/bcolor]
  if Index < CurrentRow then
    CheckBiDirectional;

  CurrentRow := Index + 1;
end;
and I made a simple example that only save and restore the bookmark and I got the same error informing wich the "Bookmark was not found"

Code: Select all

var
  BK: TBookmark;
begin
   zquery1.Open;

   BK := zquery1.GetBookmark;
   zquery1.GotoBookmark(BK);
end;
So... do I need make something more or is there a problem on Bookmark issue?

I´m use D2009 and ZeosLib7
papelhigienico
Expert Boarder
Expert Boarder
Posts: 113
Joined: 06.10.2006, 14:41
Location: Chapecó - Santa Catarina
Contact:

Post by papelhigienico »

What's is your db server? What's is your revision?
hsk
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 29.11.2009, 05:22
Location: Rio de Janeiro

Post by hsk »

papelhigienico wrote:What's is your db server? What's is your revision?
Sorry, I forgot this info. :oops:

I´m using MySQL5.1 and SVN740
papelhigienico
Expert Boarder
Expert Boarder
Posts: 113
Joined: 06.10.2006, 14:41
Location: Chapecó - Santa Catarina
Contact:

Post by papelhigienico »

Hum... rev 740 have some changes that I do.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

See bug report 204
Image
papelhigienico
Expert Boarder
Expert Boarder
Posts: 113
Joined: 06.10.2006, 14:41
Location: Chapecó - Santa Catarina
Contact:

Post by papelhigienico »

hsk... Can you try test a small change that I do in ZAbstractRODataset?

If you will test it, replace the file and rebuild ZeosLib.
You do not have the required permissions to view the files attached to this post.
papelhigienico
Expert Boarder
Expert Boarder
Posts: 113
Joined: 06.10.2006, 14:41
Location: Chapecó - Santa Catarina
Contact:

Post by papelhigienico »

And report the results here! :)
trupka
Expert Boarder
Expert Boarder
Posts: 140
Joined: 26.08.2007, 22:10

Post by trupka »

Hi!
Just tested svn rev 742 with Delphi 7/2007 and it works fine.
hsk
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 29.11.2009, 05:22
Location: Rio de Janeiro

Post by hsk »

Sorry, I was traveling...

But I did the update to SVN744 and It´s working now =)

thx for all
chentishler
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 18.01.2006, 13:45

Post by chentishler »

It seems that there are bugs with GetBookmark and GotoBookmark,
I am working with FB 2.0

When I use GetBookmarkStr, it works fine, I suspect that since in Delphi 2009 the bookmarks work with TBytes there are problems with the copy constructor of it.

Any advise of fixes?
seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Post by seawolf »

Hi, I did a test with FB 2.1.3, D2010 and the procedure posted at the begin, but I have no problems. So I suppose you encounter problems with Bookmark. Can you provide a piece of code where Bookmark raise an error?

Thank you
chentishler
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 18.01.2006, 13:45

Post by chentishler »

Hi, I am just using now GetBookmarkStr instead of GetBookmark and it works fine. I suspect that because the implementation of TBookmark is now TBytes and not just a pointer, there are problems with assignment statements of it. I think that the data that is assigned by Zeos GetBookmark is not valid after the function returns.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

chentishler,

You're right the TBytes stuff has really caused us nightmares (also take into account we also support FPC 64 bit where pointers take 8 bytes instead of 4).

Last changes affecting bookmarks were in rev 781 (testing branch) or 785 (Trunk). Is your version more recent than those?

Mark
Image
chentishler
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 18.01.2006, 13:45

Post by chentishler »

Hi Mark,

I am not sure which rev, I downloaded it on 10th Sep, 2009
Can I see the rev in the files?

I still could not understand why the TBytes caused the problem, because according to my understanding the code is correct. Any idea?

Regards,
Chen
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

No, but the changes/fixes I'm talking about date from february 2010, so they are certainly not included in your version.

Please try downloading the last snapshots from http://zeosdownloads.firmos.at/downloads/snapshots/

As I didn't make a trunk snapshot recently you should take http://zeosdownloads.firmos.at/download ... OMPACT.zip and replace your src directory with the new ones.

Mark
Image
Locked