"""$URL: svn+ssh://svn.mems-exchange.org/repos/trunk/toboso/lib/base.py $
$Id: base.py 25698 2004-12-02 16:55:30Z dbinger $
"""

from dulcinea.site_util import get_dbspec
from dulcinea.database import ObjectDatabase

_db = ObjectDatabase()

def get_database():
    return _db

def open_database(dbspec=None):
    if dbspec is None:
        dbspec = get_dbspec("toboso")
    _db.open(dbspec=dbspec)
    return _db

def close_database():
    _db.close()

def get_connection():
    return _db.connection

def get_user_db():
    return _db.user_db

def get_session_manager():
    return _db.session_manager


