Close connection on unhandled exception.
Optimize write without transactions.