Class: Dynflow::TransactionAdapters::ActiveRecord
- Defined in:
- lib/dynflow/transaction_adapters/active_record.rb
Instance Method Summary collapse
Instance Method Details
#check(world) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/dynflow/transaction_adapters/active_record.rb', line 16 def check(world) # missing reader in ConnectionPool ar_pool_size = ::ActiveRecord::Base.connection_pool.instance_variable_get(:@size) if (world.[:pool_size] / 2.0) > ar_pool_size world.logger.warn 'Consider increasing ActiveRecord::Base.connection_pool size, ' + "it's #{ar_pool_size} but there is #{world.[:pool_size]} " + 'threads in Dynflow pool.' end end |
#cleanup ⇒ Object
12 13 14 |
# File 'lib/dynflow/transaction_adapters/active_record.rb', line 12 def cleanup ::ActiveRecord::Base.clear_active_connections! end |
#rollback ⇒ Object
8 9 10 |
# File 'lib/dynflow/transaction_adapters/active_record.rb', line 8 def rollback raise ::ActiveRecord::Rollback end |
#transaction(&block) ⇒ Object
4 5 6 |
# File 'lib/dynflow/transaction_adapters/active_record.rb', line 4 def transaction(&block) ::ActiveRecord::Base.transaction(&block) end |