Franz Pletz wrote:
Hello,

I'm currently using sqlobject (current svn) in conjunction with cherrypy
(also current svn) and postgresql 8.1 for a project where I experienced
some problems while using transactions with quite a few concurrent users.



Sounds familiar... I have to use the attached patch in order for transactions to work correctly. It was posted on the list but I'm not sure if it was ever applied.

Without it, autocommit gets stuck turned off, and new transactions are started without being requested.

--
- Justin
--- dbconnection.py     2005-09-29 02:22:20.000000000 -0400
+++ /tmp/dbconnection.py        2006-02-01 12:02:54.839084219 -0500
@@ -799,6 +799,8 @@
 
     def _makeObsolete(self):
         self._obsolete = True
+        if self._dbConnection.autoCommit:
+            self._dbConnection._setAutoCommit(self._connection, 1)
         self._dbConnection.releaseConnection(self._connection,
                                              explicit=True)
         self._connection = None
@@ -809,6 +811,7 @@
         assert self._obsolete, "You cannot begin a new transaction session 
without rolling back this one"
         self._obsolete = False
         self._connection = self._dbConnection.getConnection()
+        self._dbConnection._setAutoCommit(self._connection, 0)
 
     def __del__(self):
         if self._obsolete:

Reply via email to