Don't call ATTACH in a transaction

We get a warning about commit being ineffective with Autocommit active.