Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-05

Workaround for issue #5093

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexander Todorov

Hello,
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.

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.

Thanks.

Reply by email

Joost van der Sluis
to Alexander Todorov
Show quoted text 7 lines
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.

Reply by email