The transaction should still be closed, but the error message is wrong if it's not a write transaction.