Made transaction management work even before the first SQL query.

Thanks Florian again.