Date: 2007-03-16 09:46:03 -0600 (Fri, 16 Mar 2007)
New Revision: 2415
Documentation update - connection pooling and transactions.
--- SQLObject/branches/0.8/docs/SQLObject.txt 2007-03-16 15:45:41 UTC (rev 2414)
+++ SQLObject/branches/0.8/docs/SQLObject.txt 2007-03-16 15:46:03 UTC (rev 2415)
@@ -1314,6 +1314,19 @@
Similar to `MultipleJoin`, but returns just one object, not a list.
+Connection object acquires a new low-level DB API connection from the pool
+and stores it; the low-level connection is removed from the pool;
+"releasing" means "return it to the pool". For single-threaded programs
+there is one connection in the pool.
+If the pool is empty a new low-level connection opened; if one has
+disabled pooling (by setting conn._pool = None) the connection will be
+closed instead of returning to the pool.
@@ -1332,8 +1345,20 @@
database connection, and `commit` and `rollback` just pass that
message to the low-level connection.
-If you want to begin a new transaction after a .rollback() call .begin().
+One can call as much .commit()'s, but after a .rollback() one has to call
+.begin(). The last .commit() should be called as .commit(close=True) to
+release low-level connection.
+If you want to use transactions you should also turn `_cacheValues`
+ class Person(SQLObject):
+ _cacheValue = False
+This, though, makes attribute access very slow (SQLObject queries database
+for an every attribute access). If one wants to set `_cacheValue = True`
+one has to synchronize objects between threads herself.
You can use SELECT FOR UPDATE in those databases that support it::
Get latest updates about Open Source Projects, Conferences and News.