Module | Sequel::JDBC::Transactions |
In: |
lib/sequel/adapters/jdbc/transactions.rb
|
TRANSACTION_BEGIN | = | 'Transaction.begin'.freeze |
TRANSACTION_COMMIT | = | 'Transaction.commit'.freeze |
TRANSACTION_RELEASE_SP | = | 'Transaction.release_savepoint'.freeze |
TRANSACTION_ROLLBACK | = | 'Transaction.rollback'.freeze |
TRANSACTION_ROLLBACK_SP | = | 'Transaction.rollback_savepoint'.freeze |
TRANSACTION_SAVEPOINT | = | 'Transaction.savepoint'.freeze |
JDBC_TRANSACTION_ISOLATION_LEVELS | = | {:uncommitted=>JavaSQL::Connection::TRANSACTION_READ_UNCOMMITTED, :committed=>JavaSQL::Connection::TRANSACTION_READ_COMMITTED, :repeatable=>JavaSQL::Connection::TRANSACTION_REPEATABLE_READ, :serializable=>JavaSQL::Connection::TRANSACTION_SERIALIZABLE} |
Check the JDBC DatabaseMetaData for savepoint support
# File lib/sequel/adapters/jdbc/transactions.rb, line 12 12: def supports_savepoints? 13: return @supports_savepoints if defined?(@supports_savepoints) 14: @supports_savepoints = synchronize{|c| c.getMetaData.supports_savepoints} 15: end
Check the JDBC DatabaseMetaData for support for serializable isolation, since that‘s the value most people will use.
# File lib/sequel/adapters/jdbc/transactions.rb, line 19 19: def supports_transaction_isolation_levels? 20: synchronize{|conn| conn.getMetaData.supportsTransactionIsolationLevel(JavaSQL::Connection::TRANSACTION_SERIALIZABLE)} 21: end