<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to patches</title><link href="https://sourceforge.net/p/jonpy/patches/" rel="alternate"/><link href="https://sourceforge.net/p/jonpy/patches/feed.atom" rel="self"/><id>https://sourceforge.net/p/jonpy/patches/</id><updated>2010-09-17T22:07:26Z</updated><subtitle>Recent changes to patches</subtitle><entry><title>rollback() method for temporary cursor</title><link href="https://sourceforge.net/p/jonpy/patches/2/" rel="alternate"/><published>2010-09-17T22:07:26Z</published><updated>2010-09-17T22:07:26Z</updated><author><name>rrae</name><uri>https://sourceforge.net/u/rrae/</uri></author><id>https://sourceforge.net9d5de61484d41eba58ebf35dea1653b715dd68f9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;as a call of dbpool.cursor() may create a new connection, it is neccessary to be able to do a rollback() on &amp;gt;that&amp;lt; connection, a call to dbpool.rollback does obviously no sense, here. to not have to call rollback on the hidden _connection attribute, i added a rollback method to _Cursor&lt;/p&gt;
&lt;p&gt;this patch is meant for dbpool.py in jonpy-0.09&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>dbpool._connection_notinuse weakref exceptions quick-fix</title><link href="https://sourceforge.net/p/jonpy/patches/1/" rel="alternate"/><published>2004-09-27T11:16:21Z</published><updated>2004-09-27T11:16:21Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.netb6b8fb2a7bf6d1f15e280846c95c9be9432d3442</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I got funny exceptions in the _connection_notinuse&lt;br /&gt;
function of dbpool.py. My hunch was that because I&lt;br /&gt;
instantiated many threads at the same time, all using&lt;br /&gt;
the same connection, they maybe all entering this&lt;br /&gt;
function at the same time. _make_available has a lock,&lt;br /&gt;
but the rest of the stuff in _connection_notinuse isn't&lt;br /&gt;
inside a lock. so I added another lock&lt;br /&gt;
(_lock_not_in_use) which I aquire inside the&lt;br /&gt;
_connection_notinuse function and release at the end.&lt;/p&gt;
&lt;p&gt;This got rid of the errors. Haven't tested extensively,&lt;br /&gt;
but things seem to work fine now. I'm not a python (and&lt;br /&gt;
especially not a threading) guru yet, so I'm not sure&lt;br /&gt;
if this is the most efficient fix, but it does at least&lt;br /&gt;
help proove my theory, I think.&lt;/p&gt;
&lt;p&gt;(by the way - great module. Exactly what I was looking&lt;br /&gt;
for. Saved me a lot of work)&lt;/p&gt;
&lt;p&gt;--- dbpool.py  2002-07-03 18:50:38.000000000 +0200&lt;br /&gt;
+++ jonpy-0.06/jon/dbpool.py    2004-09-27&lt;br /&gt;
12:30:04.000000000 +0200&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;/p&gt;
&lt;p&gt;_dbmod = None&lt;br /&gt;
_lock = _thread.allocate_lock()&lt;br /&gt;
+_lock_not_in_use = _thread.allocate_lock()&lt;br /&gt;
_refs = {}&lt;/p&gt;
&lt;p&gt;@@ -62,6 +63,8 @@&lt;/p&gt;
&lt;p&gt;def _connection_notinuse(ref):&lt;br /&gt;
+  _lock_not_in_use.acquire()&lt;br /&gt;
+  try:&lt;br /&gt;
inner = _refs[ref]&lt;br /&gt;
del _refs[ref]&lt;br /&gt;
inner._cursorref = None&lt;br /&gt;
@@ -71,6 +74,8 @@&lt;br /&gt;
if _make_available is not None:&lt;br /&gt;
_make_available(_Connection(inner))&lt;/p&gt;
&lt;p&gt;+  finally:&lt;br /&gt;
+    _lock_not_in_use.release()&lt;/p&gt;
&lt;p&gt;class _Connection:&lt;br /&gt;
def __init__(self, inner, *args, **kwargs):&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>