<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to patches</title><link>https://sourceforge.net/p/jonpy/patches/</link><description>Recent changes to patches</description><atom:link href="https://sourceforge.net/p/jonpy/patches/feed.rss" rel="self"/><language>en</language><lastBuildDate>Fri, 17 Sep 2010 22:07:26 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/jonpy/patches/feed.rss" rel="self" type="application/rss+xml"/><item><title>rollback() method for temporary cursor</title><link>https://sourceforge.net/p/jonpy/patches/2/</link><description>&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;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">rrae</dc:creator><pubDate>Fri, 17 Sep 2010 22:07:26 -0000</pubDate><guid>https://sourceforge.net9d5de61484d41eba58ebf35dea1653b715dd68f9</guid></item><item><title>dbpool._connection_notinuse weakref exceptions quick-fix</title><link>https://sourceforge.net/p/jonpy/patches/1/</link><description>&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;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Mon, 27 Sep 2004 11:16:21 -0000</pubDate><guid>https://sourceforge.netb6b8fb2a7bf6d1f15e280846c95c9be9432d3442</guid></item></channel></rss>