Method: Mongo::Session#in_transaction?

Defined in:
lib/mongo/session.rb

#in_transaction?true | false

Whether or not the session is currently in a transaction.

Examples:

Is the session in a transaction?

session.in_transaction?

Returns:

  • (true | false)

    Whether or not the session in a transaction.

Since:

  • 2.6.0



812
813
814
# File 'lib/mongo/session.rb', line 812

def in_transaction?
  within_states?(STARTING_TRANSACTION_STATE, TRANSACTION_IN_PROGRESS_STATE)
end