Throw error when transaction is not ended