Fix nested transactions not supported

Use finally block to commit transaction and release session