[sqlalchemy] Re: [MySQL] Checking if commit() is available

2007-06-11 Thread Michael Bayer
On Jun 11, 2007, at 6:46 PM, Monty Taylor wrote: > > Um - transactions have happily been there since 3.23.15. :) > > So the "best" way to do this is to check the db version and see if > it's > greater than 3.23.15 or not. > > "show variables like 'version'" will do the trick to get you the > v

[sqlalchemy] Re: [MySQL] Checking if commit() is available

2007-06-11 Thread Monty Taylor
Michael Bayer wrote: > > On Jun 8, 2007, at 2:17 PM, Andreas Jung wrote: > >> >> --On 8. Juni 2007 14:05:39 -0400 Rick Morrison >> <[EMAIL PROTECTED]> wrote: >> >>> try: >>> t.commit() >>> except: >>> print 'Holy cow, this database is lame' >>> >>> >> This code is also lame :-) The cod

[sqlalchemy] Re: [MySQL] Checking if commit() is available

2007-06-08 Thread Michael Bayer
On Jun 8, 2007, at 2:17 PM, Andreas Jung wrote: > > > --On 8. Juni 2007 14:05:39 -0400 Rick Morrison > <[EMAIL PROTECTED]> wrote: > >> try: >> t.commit() >> except: >> print 'Holy cow, this database is lame' >> >> > > This code is also lame :-) The code should work > for arbitrary DSNs

[sqlalchemy] Re: [MySQL] Checking if commit() is available

2007-06-08 Thread Rick Morrison
Well it's not so evil if all you're doing is testing to see if commit() is available -- I wasn't trying to suggest that it was a great pattern for your whole application. On 6/8/07, Andreas Jung <[EMAIL PROTECTED]> wrote: > > > > --On 8. Juni 2007 14:05:39 -0400 Rick Morrison <[EMAIL PROTECTED]> >

[sqlalchemy] Re: [MySQL] Checking if commit() is available

2007-06-08 Thread Andreas Jung
--On 8. Juni 2007 14:05:39 -0400 Rick Morrison <[EMAIL PROTECTED]> wrote: try: t.commit() except: print 'Holy cow, this database is lame' This code is also lame :-) The code should work for arbitrary DSNs and swallowing an exception while committing is evil, evil, evil. -aj pgp

[sqlalchemy] Re: [MySQL] Checking if commit() is available

2007-06-08 Thread Rick Morrison
try: t.commit() except: print 'Holy cow, this database is lame' On 6/8/07, Andreas Jung <[EMAIL PROTECTED]> wrote: > > is there a way to determine if the underlying MySQL DB is able to perform > a commit() operation? The following code fails (likely because the > underlying MySQL db is p