Author: phd
Date: 2007-07-17 08:12:46 -0600 (Tue, 17 Jul 2007)
New Revision: 2760
Modified:
SQLObject/branches/0.9/docs/News.txt
SQLObject/branches/0.9/sqlobject/declarative.py
Log:
A patch by Bernhard <ber...@zk...>:
Prevent a deadlock in declarative.threadSafeMethod() by not reacquiring the class lock.
Modified: SQLObject/branches/0.9/docs/News.txt
===================================================================
--- SQLObject/branches/0.9/docs/News.txt 2007-07-17 14:12:29 UTC (rev 2759)
+++ SQLObject/branches/0.9/docs/News.txt 2007-07-17 14:12:46 UTC (rev 2760)
@@ -247,6 +247,9 @@
* Fixed a bug with default field values for columns for firebird connection.
+* Prevent a deadlock in declarative.threadSafeMethod() by not reacquiring
+ the class lock.
+
SQLObject 0.7.7
===============
Modified: SQLObject/branches/0.9/sqlobject/declarative.py
===================================================================
--- SQLObject/branches/0.9/sqlobject/declarative.py 2007-07-17 14:12:29 UTC (rev 2759)
+++ SQLObject/branches/0.9/sqlobject/declarative.py 2007-07-17 14:12:46 UTC (rev 2760)
@@ -89,6 +89,10 @@
def threadSafeMethod(lock):
def decorator(fn):
def _wrapper(self, *args, **kwargs):
+ # This prevents deadlocks.
+ # The class lock isn't really needed in __init__() while fetching.
+ if '_SO_fetch_no_create' in kwargs:
+ return fn(self, *args, **kwargs)
lock.acquire()
try:
return fn(self, *args, **kwargs)
|