[fpc-devel] Implicit Transactions Postgres

Chris Dryburgh cdryburghca at netscape.net
Tue Nov 25 16:26:54 CET 2014

On 25/11/14 03:47 AM, Michael Van Canneyt wrote:
> On Mon, 24 Nov 2014, Chris Dryburgh wrote:
>> Found this bug report from 2010 on using implicit transactions in 
>> PostgreSQL. As far as I can tell nothing has happened since. Using 
>> the TSQLTransaction.Action setting looks like a good approach to 
>> implementing implicit transactions. It would mean warning users about 
>> setting action as it currently does nothing and is likely ignored by 
>> many programmers.
>> http://bugs.freepascal.org/view.php?id=17713
>> There is another reason to use implicit transactions. When creating 
>> or dropping a database the query must be run in a implicit 
>> transaction. Currently createDB and dropDB use implicit transactions 
>> but do not allow for options beyond the required database name.
>> Implementing implicit transactions will compliment the transaction 
>> patch from Michael. His patch allows automatically opened 
>> transactions to be closed without closing datasets which allows for 
>> user managed transaction handling.
> Please check the sources, I have additionally implemented 
> toUseImplicit. I tested it using postgres (as firebird does not 
> support it).
> Michael.
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
It looks like implicit transaction code went in a couple of days ago. 
Seams to only apply to Postgres currently but the frame work is there to 
apply to other databases. I see the other transaction patch 
TSQLTransaction.AllowClose in there as well. This is good news for SQLdb 
and with talk of a branch happening soon just in time.

More information about the fpc-devel mailing list