from orangescape.model.server.Context import getApplication

def getSession():
    import appconfig as config
    if config.env == config.GAESQL:
        from orangescape.model.server.sql.SQLSession import SQLSession as PrimarySession
    else:
        from orangescape.model.server.GFSSession import PrimaryGFSSession as PrimarySession
    return PrimarySession(getApplication())