[Devel] postgres problem - request for comments

Klaus Darilion klaus.mailinglists at pernau.at
Tue Sep 13 20:06:44 CEST 2005


I have implemented version 1, as the re-connect handling is in 
begin_transaction() and I did not wanted to touch that code :-)

regards
klaus

Klaus Darilion wrote:
> Hi!
> 
> I discovered a problem in the postgres module. Every 
> insert/update/delete will be done in a transaction:
> 
>   1. begin_transaction
>   2. submit_query
>   3. commit_transaction
> 
> If the query fails, the commit is never sent to postgres (nor a 
> rollback). thus the transaction is still running and the next time the 
> database connection is used, the begin_transaction fails nad a new db 
> connection will be established.
> 
> There are 2 solutions:
> 
> - fetch the error in submit_query and send a rollback
> 
> - remove the transaction: no begin_transaction and commit_transaction,
>   only a submit_query
> 
> As there is always only one query in the transaction I might be safe to 
> remove the transaction stuff (as in the mysql module)
> 
> regards
> klaus
> 
> _______________________________________________
> Devel mailing list
> Devel at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/devel
> 
> 




More information about the Devel mailing list