SQLAlchemy 0.4 Documentation

Multiple Pages | One Page
Version: 0.4 Last Updated: 10/17/07 13:56:48

module sqlalchemy.engine.threadlocal

class TLConnection(Connection)

def __init__(self, session, connection, close_with_result)

Construct a new TLConnection.

def begin(self, **kwargs)
def begin_twophase(self, xid=None)
def close(self)
def in_transaction(self)
session = property()
back to section top

class TLEngine(Engine)

An Engine that includes support for thread-local managed transactions.

The TLEngine relies upon its Pool having "threadlocal" behavior, so that once a connection is checked out for the current thread, you get that same connection repeatedly.

def __init__(self, *args, **kwargs)

Construct a new TLEngine.

def begin(self, **kwargs)
def commit(self)
def contextual_connect(self, **kwargs)

Return a TLConnection which is thread-locally scoped.

def rollback(self)
session = property()

Returns the current thread's TLSession

back to section top

class TLSession(object)

def __init__(self, engine)

Construct a new TLSession.

def begin(self, **kwargs)
def begin_twophase(self, xid=None)
def commit(self)
def get_connection(self, close_with_result=False)
def in_transaction(self)
def is_begun(self)
def prepare(self)
def reset(self)
def rollback(self)
back to section top

class TLTransaction(Transaction)

def __init__(self, trans, session)

Construct a new TLTransaction.

def commit(self)
connection = property()
is_active = property()
def prepare(self)
def rollback(self)
def __enter__(self)
def __exit__(self, type, value, traceback)
back to section top
Up: API Documentation | Previous: module sqlalchemy.engine.url | Next: module sqlalchemy.exceptions