Package turbogears :: Module database :: Class AutoConnectHub

Class AutoConnectHub

source code

                          object --+    
                                   |    
sqlobject.dbconnection.ConnectionHub --+
                                       |
                                      AutoConnectHub

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

Instance Methods
 
__init__(self, uri=None, supports_transactions=True)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
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 object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  params = {}
  uri = None
hash(x)
Properties

Inherited from sqlobject.dbconnection.ConnectionHub: threadConnection

Inherited from object: __class__

Method Details

__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)

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.