Close connection at end of transaction