[fpc-devel] PostgreSQL SQLdb transactions

Michael Van Canneyt michael at freepascal.org
Wed Nov 5 09:02:41 CET 2014

On Tue, 4 Nov 2014, Chris Dryburgh wrote:

> Hi
> In PostgreSQL it is considered poor practice to have long running idle transactions.
> https://encrypted.google.com/#q=postgresql+idle+in+transaction

This is a known problem, not only for postgres.

The problem is the open transaction for an open dataset: committing the transaction (what you would normally do)
will close the dataset.

The solution for which I have code in place is a flag which tells the transaction that a connected dataset 
should not be closed when the transaction is committed.
The transaction can then be committed or rollbacked as soon as the data is fetched.

I have code for this in place that works for all connection types. 
But it still needs to be checked through the testsuite.


More information about the fpc-devel mailing list