-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Description
Quartz Version: 2.3.2
Database Version: KingbaseES V009R001C001B0030 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28), 64-bit
(Based PGSql)
java.sql.Connection.setTransactionIsolation
documentation says:
Note: If this method is called during a transaction, the result is implementation-defined.
In AttributeRestoringConnectionInvocationHandler
, you call setTransactionIsolation
before you commit / rollback the transaction. So the result is non-determined.
/**
* Attempts to restore the auto commit and transaction isolation connection
* attributes of the wrapped connection to their original values (if they
* were overwritten).
*/
public void restoreOriginalAtributes() {
try {
if (overwroteOriginalAutoCommitValue) {
conn.setAutoCommit(originalAutoCommitValue);
}
} catch (Throwable t) {
getLog().warn("Failed restore connection's original auto commit setting.", t);
}
try {
if (overwroteOriginalTxIsolationValue) {
conn.setTransactionIsolation(originalTxIsolationValue);
}
} catch (Throwable t) {
getLog().warn("Failed restore connection's original transaction isolation setting.", t);
}
}
In Kingbase, following exception will raised:
com.kingbase8.util.KSQLException: Cannot change transaction isolation lev in the middle of a transaction.
RISK:
- Polluting connections in the shared connection pool(because failed of restore).
But i think one (who share the same connection pool with you) can not assume anything about the connections in pool.
- I don't know if can cause starvation of other lock competitors(because not commit the transaction)
Metadata
Metadata
Assignees
Labels
No labels