Exception using TryKeepDataOnDisconnect property

The offical for ZeosLib 7.3 Report problems, ask for help, post proposals for the new version of Zeoslib 7.3/v8
Quick Info:
-We made two new drivers: odbc(raw and unicode version) and oledb
-GUID domain/field-defined support for FB
-extended error infos of Firebird
-performance ups are still in queue
In future some more feature will arrive, so stay tuned and don't hassitate to help
Post Reply
brunodelmondes
Fresh Boarder
Fresh Boarder
Posts: 24
Joined: 28.10.2020, 15:12
Location: Brazil

Exception using TryKeepDataOnDisconnect property

Post by brunodelmondes »

Hi there!

I'm using Zeos SVN 7378 on Delphi 2010 + Firebird 2.1 testing new behavior of TryKeepDataOnDisconnect property on datasets.
Considering the sequence of the code below, it causes the EZIBSQLException = -904 Message: isc_dsql_allocate_statement.

#1 - Connect the database and open the query with some properties

Code: Select all

procedure TForm1.btnOpenClick(Sender: TObject);
begin
  if not ZConnection1.Connected then
    ZConnection1.Connect;

  if ZQuery1.Active then
    ZQuery1.Close;

  ZQuery1.CachedUpdates := true;
  ZQuery1.TryKeepDataOnDisconnect := true;

  ZQuery1.Open;
end;
#2 - Disconnect from the database

Code: Select all

procedure TForm1.btnConnDisconnClick(Sender: TObject);
begin
    if not ZConnection1.Connected then
      ZConnection1.Connect
    else
      ZConnection1.Disconnect;
end;
#3 - Did some changes and post them, then I execute the below code

Code: Select all

procedure TForm1.btnApplyUpdatesClick(Sender: TObject);
begin
  if ZQuery1.UpdatesPending then
  begin
    if not ZConnection1.Connected then
      ZConnection1.Connect;
    ZQuery1.ApplyUpdates;
    ZQuery1.CommitUpdates;
    ZQuery1.Refresh;
  end;
end;
I realize that the exception occurs when ZQuery1.Refresh executes. The same happens if I execute ZQuery1.Close followed by ZQuery1.Open;
Last edited by brunodelmondes on 10.03.2021, 12:14, edited 1 time in total.
Bruno Delmondes
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: Exception using TryKeepDataOnDisconnect property

Post by marsupilami »

Hello Bruno,

could you please open a bug report on SourceForge for this?

Best regards,

Jan
brunodelmondes
Fresh Boarder
Fresh Boarder
Posts: 24
Joined: 28.10.2020, 15:12
Location: Brazil

Re: Exception using TryKeepDataOnDisconnect property

Post by brunodelmondes »

Yeah, no problem.

Thanks Jan!
Bruno Delmondes
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Exception using TryKeepDataOnDisconnect property

Post by EgonHugeist »

Hi Bruno,
your are faster on testing than me on announcing the features.

Bruno i'll check your examples. The FB exception should not be thrown. Thus i accapt the ticket. What i miss in your code is:

Code: Select all

Query/Table.FetchAll
That's why the property starts with "Try". I still think it's not a good idea for automatic load all data even if the property is enabled.

So can you test my remarks and report your findings?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
brunodelmondes
Fresh Boarder
Fresh Boarder
Posts: 24
Joined: 28.10.2020, 15:12
Location: Brazil

Re: Exception using TryKeepDataOnDisconnect property

Post by brunodelmondes »

Hi Michael,
your are faster on testing than me on announcing the features.
LOL
That's because I like Zeoslib so much and that feature will be very very much helpful for me.
Bruno i'll check your examples. The FB exception should not be thrown. Thus i accapt the ticket. What i miss in your code is:

Code: Select all

Query/Table.FetchAll
That's why the property starts with "Try". I still think it's not a good idea for automatic load all data even if the property is enabled.
So, I tested with FetchAll after opening ZQuery and after ApplyUpdates... still same error. I forgot to mention that property FetchRow was Zero (default) when I first ran into the error.
Bruno Delmondes
Post Reply