[Biopython-dev] [Bug 2395] Need a commit in BioSQL with MySQL

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Tue Nov 13 11:18:41 UTC 2007


http://bugzilla.open-bio.org/show_bug.cgi?id=2395


biopython-bugzilla at maubp.freeserve.co.uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Need a commit in db.load    |Need a commit in BioSQL with
                   |(BioSQL with MySQL)         |MySQL




------- Comment #1 from biopython-bugzilla at maubp.freeserve.co.uk  2007-11-13 06:18 EST -------
As might be expected with hindsight, this is more general than just db.load(),
and seems to apply to any operation.

One suggestion on the mailing list from Eric Gibert,

[quote]
Finally, the script executes without error and .... nothing happens! It looks
like there is no 'commit' nowhere and so the new records are not inserted in
the database.

Although the psychopg database enjoys a:

   def autocommit(self, conn, y = True):
       conn.autocommit(y)
_dbutils["psycopg"] = Psycopg_dbutils

MySQL does not have such an overload for 'autocommit' in DBUtils.py. Could this
fix the problem ?

In the file MySQLdb/connections.py, on line 213, we have:
           # PEP-249 requires autocommit to be initially off
           self.autocommit(False)

Therefore the source for the Mysql_dbutils class is now:

class Mysql_dbutils(Generic_dbutils):
   def last_id(self, cursor, table):
       return cursor.lastrowid        #EG original command: cursor.insert_id()

   def autocommit(self, conn, y = True): # EG addition as by default it is set
to False
       conn.autocommit(y)

_dbutils["MySQLdb"] = Mysql_dbutils


Unfortunately, this is *NOT* fixing the lack of 'commit'. I need your help...
[/quote]


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list