Bases: object
Ensures that MySQL connections checked out of the pool are alive.
Borrowed from: http://groups.google.com/group/sqlalchemy/msg/a4ce563d802c929f
Bases: sqlalchemy.interfaces.PoolListener
Ensures that the foreign key constraints are enforced in SQLite.
The foreign key constraints are disabled by default in SQLite, so the foreign key constraints will be enabled here for every database connection
Establish the database, create an engine if needed, and register the models.
Helper method to grab session
Ensure other greenthreads get a chance to execute by forcing a context switch. With common database backends (eg MySQLdb and sqlite), there is no implicit yield caused by network I/O since they are implemented by C libraries that eventlet cannot monkey patch.
Register Models and create properties
Unregister Models, useful clearing out data before testing