commit vs commitretaining lazarus / 16-Databases ---------------------------------------------------------------------- mangakissa · 2014-02-03 20:01 I think it's a bug, but someone knows the opposite (I hope). I have a form where I can create a batch (of payments of the month). When a new batchnumber is created, a query is called to collect records. A button creates a XML file. During this procedure, a batchdate will be increased in periodes in giving order. All SELECT and INSERT queries are working on a separate SQLTransaction. All those things are working. When I use commitretaining and open a contactform, I can't see the batchdate is changed. When I close my application reopend it, the batchdate is changed visually. But when create a new batch again,  use commit and open a contactform, I can see the changed batchdate.  So Why is commitreaining not refressing my data correctly? ---------------------------------------------------------------------- exdatis · 2014-02-09 10:45 I use one transaction, so: try     qSomeQuery.ApplyUpdates;     transactionMain.CommitRetaining;   except     on e : Exception do     begin       qSomeQuery.CancelUpdates;       transactionMain.RollbackRetaining;       ShowMessage(e.Message);       Exit;     end;   end;  There is no problem ---------------------------------------------------------------------- exdatis · 2014-02-09 10:49 Lazarus 1.0.14, PostgreSQL 9.1 and Firebird 2.5, win7 32bit and openSuSe (Gnome) 32bit SQLdb. ---------------------------------------------------------------------- patyi · 2014-02-09 18:49 It depends on transaction isolation level. Use ReadCommited transaction isolation, also you may eventually refresh query when opening the contaktform. Commit and CommitRetaining is differs that the second is leaving sql cursor open, you not need reopen the query after commit data.