Author: phd
Date: 2007-07-17 08:11:35 -0600 (Tue, 17 Jul 2007)
New Revision: 2758
Modified:
SQLObject/branches/0.7/docs/News.txt
SQLObject/branches/0.7/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.7/docs/News.txt
===================================================================
--- SQLObject/branches/0.7/docs/News.txt 2007-07-16 12:10:23 UTC (rev 2757)
+++ SQLObject/branches/0.7/docs/News.txt 2007-07-17 14:11:35 UTC (rev 2758)
@@ -25,6 +25,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.7/sqlobject/declarative.py
===================================================================
--- SQLObject/branches/0.7/sqlobject/declarative.py 2007-07-16 12:10:23 UTC (rev 2757)
+++ SQLObject/branches/0.7/sqlobject/declarative.py 2007-07-17 14:11:35 UTC (rev 2758)
@@ -88,6 +88,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)
|