source: package_tags/sipb-xen-database/10.28/python/database/ @ 1043

Last change on this file since 1043 was 1041, checked in by broder, 16 years ago

Re-establish the database connection if the server goes AWOL

File size: 278 bytes
1from invirt.config import structs as config
2from models import *
3import sqlalchemy
5def connect(uri = config.db.uri):
6    """ Connect to a given database URI"""
7    engine = sqlalchemy.create_engine(uri, pool_timeout=5)
8    meta.bind = engine
9    session.configure(bind=engine)
Note: See TracBrowser for help on using the repository browser.