Re: [SQLObject] Trouble with threads...

2008-02-17 Thread Dan Pascu
On Sunday 17 February 2008, Nathan Edwards wrote: > Oleg Broytmann wrote: > > On Sat, Feb 16, 2008 at 10:46:41PM -0500, Nathan Edwards wrote: > >> I still get the occasional "Commands out of sync..." exception from > >> MySQLdb. > > > >Does the proposed patch help? > > Segfault, twice. > > Inte

Re: [SQLObject] Trouble with threads...

2008-02-17 Thread Dan Pascu
On Sunday 17 February 2008, Nathan Edwards wrote: > >Shouldn't that be > > sqlhub.threadConnection = connectionForURI(connuri) > > > > for i in range(1000): > > try: > > a = AAA(value=1) > > except dberrors.DuplicateEntryError: > > a = AAA.byValu

Re: [SQLObject] Trouble with threads...

2008-02-16 Thread Oleg Broytmann
On Sat, Feb 16, 2008 at 11:03:33PM -0500, Nathan Edwards wrote: > Oleg Broytmann wrote: > > On Sat, Feb 16, 2008 at 10:46:41PM -0500, Nathan Edwards wrote: > >> I still get the occasional "Commands out of sync..." exception from > >> MySQLdb. > > > >Does the proposed patch help? > > Segfault

Re: [SQLObject] Trouble with threads...

2008-02-16 Thread Nathan Edwards
Oleg Broytmann wrote: > On Sat, Feb 16, 2008 at 10:46:41PM -0500, Nathan Edwards wrote: >> I still get the occasional "Commands out of sync..." exception from MySQLdb. > >Does the proposed patch help? Segfault, twice. InterfaceError exception (no error message) other times. So, no. - n --

Re: [SQLObject] Trouble with threads...

2008-02-16 Thread Oleg Broytmann
On Sat, Feb 16, 2008 at 10:46:41PM -0500, Nathan Edwards wrote: > I still get the occasional "Commands out of sync..." exception from MySQLdb. Does the proposed patch help? Oleg. -- Oleg Broytmannhttp://phd.pp.ru/[EMAIL PROTECTED] Programmers don't die,

Re: [SQLObject] Trouble with threads...

2008-02-16 Thread Nathan Edwards
>Shouldn't that be > sqlhub.threadConnection = connectionForURI(connuri) > > for i in range(1000): > try: > a = AAA(value=1) > except dberrors.DuplicateEntryError: > a = AAA.byValue(1) Can't find any documentation for sqlhub.threadConnection, b

Re: [SQLObject] Trouble with threads...

2008-02-16 Thread Oleg Broytmann
On Sat, Feb 16, 2008 at 09:37:58PM -0500, Nathan Edwards wrote: > sqlhub.processConnection = connectionForURI(connuri) > > class AAA(SQLObject): > class sqlmeta: > createSQL = {'mysql': 'ALTER TABLE aa_a ENGINE InnoDB'} > cacheValues = False > value = IntCol(alternateID

Re: [SQLObject] Trouble with threads...

2008-02-16 Thread Nathan Edwards
There is clearly some facility built into SQLObject for threads - there is the connection pool, which is designed (per the code) to ensure only (at most?) one connection is opened per thread, and a sqlhub member called threadConnection in addition to processConnection. There is also the _conne

Re: [SQLObject] Trouble with threads...

2008-02-16 Thread Dan Pascu
On Sunday 17 February 2008, Oleg Broytmann wrote: > On Sun, Feb 17, 2008 at 12:20:54AM +0200, Dan Pascu wrote: > > If I'm for a change, then I'm for removing this limitation from > > sqlite as well rather than putting it in other backends too. > >Thank you for stepping in. > >As for SQLite

Re: [SQLObject] Trouble with threads...

2008-02-16 Thread Oleg Broytmann
On Sun, Feb 17, 2008 at 12:20:54AM +0200, Dan Pascu wrote: > If I'm for a change, then I'm for removing this limitation from sqlite as > well rather than putting it in other backends too. Thank you for stepping in. As for SQLite - the limitation is (at least was) imposed by the SQLite backe

Re: [SQLObject] Trouble with threads...

2008-02-16 Thread Dan Pascu
On Saturday 16 February 2008, Oleg Broytmann wrote: > On Sat, Feb 16, 2008 at 03:53:19PM +0200, Neil Muller wrote: > > I've added a quick patch to do this, based of the logic in > > sqliteconnection, to the sourceforge issue tracker (# 1894909), which > > fixes the issue for me. > >Thank you! >

Re: [SQLObject] Trouble with threads...

2008-02-16 Thread Oleg Broytmann
On Sat, Feb 16, 2008 at 03:53:19PM +0200, Neil Muller wrote: > I've added a quick patch to do this, based of the logic in > sqliteconnection, to the sourceforge issue tracker (# 1894909), which > fixes the issue for me. Thank you! I would very much like to ask people to review and test the

Re: [SQLObject] Trouble with threads...

2008-02-16 Thread Neil Muller
On Feb 12, 2008 4:21 AM, Nathan Edwards <[EMAIL PROTECTED]> wrote: > The MySQLdb error: > > Exception _mysql_exceptions.ProgrammingError: (2014, "Commands out of > sync; you can't run this command now") in Cursor.__del__ of > > ignored > > is pretty consistent, and sometimes I get

Re: [SQLObject] Trouble with threads...

2008-02-12 Thread Oleg Broytmann
On Tue, Feb 12, 2008 at 09:18:02AM -0500, Nathan Edwards wrote: > Oleg Broytmann wrote: > >My guess is that after any unhandled exception you must rollback the > > connection. > > I'm not using transactions explicitly, each insert is atomic, so > autoCommit is fine for me. Then my guess i

Re: [SQLObject] Trouble with threads...

2008-02-12 Thread Nathan Edwards
Oleg Broytmann wrote: > On Mon, Feb 11, 2008 at 09:21:56PM -0500, Nathan Edwards wrote: >> If I change "a = A.byValue(1)" to "pass" the exceptions go away...it >> seems like the exception puts the connection in a bad state. > >My guess is that after any unhandled exception you must rollback t

Re: [SQLObject] Trouble with threads...

2008-02-12 Thread Oleg Broytmann
On Mon, Feb 11, 2008 at 09:21:56PM -0500, Nathan Edwards wrote: > If I change "a = A.byValue(1)" to "pass" the exceptions go away...it > seems like the exception puts the connection in a bad state. My guess is that after any unhandled exception you must rollback the connection. Oleg. --

[SQLObject] Trouble with threads...

2008-02-11 Thread Nathan Edwards
I'm trying to use SQLObject (0.9.3) in conjunction with the threading module. I'm at a bit of a loss as to where to start debugging this one, so I'll present my mini-example and see if others can help. This is using MySQL, with MySQLdb 1.2.2 (latest version) & SQLObject 0.9.3. class A(SQLObje