Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.
I'm trying to check if my current session to the database has any uncommitted changes (e.g. a DELETE without a commit)
Is the value in the column TRANSACTION_SIZE in INFORMATION_SCHEMA.SYSTEM_SESSIONS a reliable way to do this?
As far as I can tell anything greater than zero indicates a non-committed DML statement.
I don't care if there are false positives (i.e. a non-zero value even if nothing has changed), but a false negative (a zero even though something has changed) would not be so good (although not a real problem).
You can rely on this value. It is always accurate.
For example, if a rollback to a savepoint has been made, the value indicates the size of the remaining changes after the rollback. If a row has been changed multiple times, each change is counted.
Thanks for the quick answer.