allow the dbsession to be a callable