Bug Fix: Check if a transaction is still active before committing, when dealing with read-only transactions.