def open_dbsession():
    cherrypy.request.scoped_session_class = (cherrypy.thread_data.
        scoped_session_class)
Best practice for integrating CherryPy web-framework, SQLAlchemy sessions and lighttpd to serve a high-load webservice