Package turbogears :: Module database :: Class AutoConnectHub
[hide private]

Class AutoConnectHub

source code


Connects to the database once per thread. The AutoConnectHub also provides convenient methods for managing transactions.

Instance Methods [hide private]
 
__init__(self, uri=None, supports_transactions=True)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_enable_timestamp_workaround(self, connection)
Enable a workaround for an incompatible timestamp format change in MySQL 4.1 when using an old version of MySQLdb.
source code
 
_is_interesting_version(self)
Return True only if version of MySQLdb <= 1.0.
source code
 
begin(self, conn=None)
Start a transaction.
source code
 
commit(self)
Commit the current transaction.
source code
 
end(self)
End the transaction, returning to a standard connection.
source code
 
getConnection(self) source code
 
reset(self)
Used for testing purposes.
source code
 
rollback(self)
Rollback the current transaction.
source code

Inherited from sqlobject.dbconnection.ConnectionHub: __get__, __set__, doInTransaction

Inherited from sqlobject.dbconnection.ConnectionHub (private): _del_threadConnection, _get_threadConnection, _set_threadConnection

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  params = {}
  uri = None
Properties [hide private]

Inherited from sqlobject.dbconnection.ConnectionHub: threadConnection

Inherited from object: __class__

Method Details [hide private]

__init__(self, uri=None, supports_transactions=True)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

_enable_timestamp_workaround(self, connection)

source code 

Enable a workaround for an incompatible timestamp format change in MySQL 4.1 when using an old version of MySQLdb. See trac ticket #1235 - http://trac.turbogears.org/ticket/1235 for details.

getConnection(self)

source code 
Overrides: sqlobject.dbconnection.ConnectionHub.getConnection

reset(self)

source code 

Used for testing purposes. This drops all of the connections that are being held.