Bug 939598. Always call BeginTransaction before EndTransaction. r=mattwoodrow