Hi-
can someone glance at this really quick if you use fb with zeos and lazarus?
I'd really like to use lazarus equivalent to isql-fb:
read committed with no record_version.
THX!
In isql-fb I have:
set transaction read write wait isolation level read committed no record_version
then I do an update and not commit it yet (auto-commit is not on)
in lazarus i use the zconnection with these properties and set to read committed:
isc_tpb_concurrency
isc_tpb_wait
isc_tpb_no_rec_version
I do the pending change in isql-fb first (it is an update).
then I set connected to false in zconnection and then put it to true and activate the zquery.
I get a no wait transaction error. I thought I told it to wait in two different clients.
not sure what I am missing. it behaves as expected with 2 isql-fb clients.
also I have this code oncommit:
procedure TForm1.SaveChanges;
begin
// Saves edits done by user, if any.
with ZConnection1 do
begin
if AutoCommit then
begin
StartTransaction;
// Only if we are within a started transaction;
// otherwise you get "Operation cannot be performed on an inactive dataset"
try
ZQuery1.ApplyUpdates; //Pass user-generated changes back to database...
Commit; //... and commit them using the transaction.
//SQLTransaction1.Active now is false
except
MessageDlg('Error', 'A database error has occurred. Technical error message: ' +
'foo', mtError, [mbOK], 0);
Rollback;
end;
Datasource1.DataSet.Refresh;
end;
end;
end;
procedure TForm1.ZConnection1Commit(Sender: TObject);
begin
SaveChanges;
end;