[Devel] postgres problem - request for comments

Michael Ulitskiy mdu113 at acedsl.com
Tue Sep 13 17:20:23 CEST 2005


AFAIK if you don't use BEGIN/COMMIT explicitly then postgresql is running
every query within implicit BEGIN/COMMIT block.
So if in foreseeable future you can't see any use for transactions
that involves more than one query within openser then I'd say
removing transaction stuff from the module is good enough.
On the other hand if adding rollback isn't too hard then I believe this
is more correct approach from the general point of view.

Michael

On Tuesday 13 September 2005 08:52 am, 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