Displaying 3 results from an estimated 3 matches for "decrement_open_transact".
2008 Apr 04
2
TransactionError
...on(&block)
previous_handler = trap(''TERM'') { raise TransactionError, "Transaction aborted" }
increment_open_transactions
begin
connection.transaction(Thread.current[''start_db_transaction''], &block)
ensure
decrement_open_transactions
trap(''TERM'', previous_handler)
end
end
[...]
Above this, there''s
"Both Base#save and Base#destroy come wrapped in a transaction [...]"
and
"Also have in mind that exceptions thrown within a transaction block will be
propagated [...]...
2006 Aug 14
6
Testing fails with fixtures not when invoked directly
...faults_to_parent(OrganizationTest):
NoMethodError: You have a nil object when you didn''t expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.-
D:/workspace/directory/config/../vendor/rails/activerecord/lib/active_record/transactions.
rb:107:in `decrement_open_transactions''
D:/workspace/directory/config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:5
45:in `teardown''
********** Files are as below ***********
****** organizations.yml **
smo:
id: 1
name: SLC Systems Management Office
cost_code: 8211
routing:
type: Depar...
2012 Apr 27
3
rails console --sandbox is only half-baked
...handled by ActiveRecord:
activerecord/lib/active_record/railties/console_sandbox.rb:
ActiveRecord::Base.connection.increment_open_transactions
ActiveRecord::Base.connection.begin_db_transaction
at_exit do
ActiveRecord::Base.connection.rollback_db_transaction
ActiveRecord::Base.connection.decrement_open_transactions
end
This only handles the default database as noticed by Jeremy. If you have
models relying on different databases, only the default one will be
sandboxed.
Additionally, there is another design issue. For example, Sequel was
designed in a way that it won''t allow users to directly...