session: fix commit after automatic table creation

* Fixes `commit()` call on database session object.  (PR #2265)

Reviewed-by: Jiri Kuncar <jiri.kuncar@cern.ch>