Opens a DB session and begins a transaction.