1. David McNelis
  2. sqlalchemy


Mike Bayer  committed eb00664

fixed the raise for mysql to re-raise the error

  • Participants
  • Parent commits 4a63b2d
  • Branches default
  • Tags rel_0_3_3

Comments (0)

Files changed (5)


View file
 - string-based FROM clauses fixed, i.e. select(..., from_obj=["sometext"])
 - fixes to passive_deletes flag, lazy=None (noload) flag
 - added example/docs for dealing with large collections
 that was not reachable (thanks to Sébastien Lelong), also fixed dispose()
 - patch that makes MySQL rowcount work correctly! [ticket:396]
+- fix to MySQL catch of 2006/20014 errors
 - major connection pool bug fixed.  fixes MySQL out of sync
 errors, will also prevent transactions getting rolled back

File doc/build/content/adv_datamapping.txt

View file
 #### Working with Large Collections
-(requires some bugfixes released as of version 0.3.3)
 SQLAlchemy relations are generally simplistic; the lazy loader loads in the full list of child objects when accessed, and the eager load builds a query that loads the full list of child objects.  Additionally, when you are deleting a parent object, SQLAlchemy insures that it has loaded the full list of child objects so that it can mark them as deleted as well (or to update their parent foreign key to NULL).  It does not issue an en-masse "delete from table where parent_id=?" type of statement in such a scenario.  This is because the child objects themselves may also have further dependencies, and additionally may also exist in the current session in which case SA needs to know their identity so that their state can be properly updated.
 So there are several techniques that can be used individually or combined together to address these issues, in the context of a large collection where you normally would not want to load the full list of relationships:

File doc/build/genhtml.py

View file
 title='SQLAlchemy 0.3 Documentation'
-version = '0.3.2'
+version = '0.3.3'
 root = toc.TOCElement('', 'root', '', version=version, doctitle=title)

File lib/sqlalchemy/databases/mysql.py

View file
         except mysql.OperationalError, o:
             if o.args[0] == 2006 or o.args[0] == 2014:
-                raise o
+            raise o
     def do_execute(self, cursor, statement, parameters, **kwargs):
             cursor.execute(statement, parameters)
         except mysql.OperationalError, o:
             if o.args[0] == 2006 or o.args[0] == 2014:
-                raise o
+            raise o
     def do_rollback(self, connection):

File setup.py

View file
 from setuptools import setup, find_packages
 setup(name = "SQLAlchemy",
-    version = "0.3.2",
+    version = "0.3.3",
     description = "Database Abstraction Library",
     author = "Mike Bayer",
     author_email = "mike_mp@zzzcomputing.com",