[fpc-devel] Workaround for issue #5093

Joost van der Sluis joost at cnoc.nl
Wed May 10 13:56:22 CEST 2006


> recently I have reported this issue on the FPC site and there were
> some e-mails about SQLDb not working with PostgreSQL.
> http://www.freepascal.org/bugs/showrec.php3?ID=5093
> 
> The work around for TPQConnection is:
> Do NOT use FTransaction.Commit but USE FTransaction.CommitRetaining instead.
> It is working for me this way.

?

For me a reason to look at your bug-report. I assumed that it was the
postgres-problem. But now i see that it's a bug in your code.

FTrans.Commit closes the transaction. So if you want to execute a new
sql-statement, you have to open it again: FTrans.StartTransaction.

> PS: This is not working with PostgreSQL but is working with Firebird.
> I am not able to test with MySQL at the moment. Could someone test it
> please? If possible test with other types of connections provided with
> SQLdb.

CommitRetaining is committing a database, without closing the
transaction (or, in fact: it reopens it immidiately) and is actually a
Firebird-only feature. 

However I try to make it work with Postgres.

The mysql-connection doesn't support transactions, thus it hasn't these
problems. (It has some others...)

Btw: there is some bug in issue 5093, and that is that the transaction
should be opened automatically. I'll look where this goes wrong.

Joost.




More information about the fpc-devel mailing list