search for: commit_db_transact

Displaying 7 results from an estimated 7 matches for "commit_db_transact".

2006 Apr 25
2
Transactions and migrations (lots of records)???
...What I want to do is start a transaction before I start looping then watch a counter and every 50th time, commit, then open another one. Then have a final commit. I''ll deal with errors elsewhere... right now I just need it to go faster. I have a feeling I want begin_db_transaction and commit_db_transaction, but I can''t figure out how to use them in the way I want. Help! :-) -philip
2006 Jun 15
4
testing with transactions
...end yield end rescue Exception => database_transaction_rollback if transaction_open transaction_open = false rollback_db_transaction end if savepoint_open savepoint_open = false rollback_to_savepoint(savepoint_name) end raise end ensure commit_db_transaction if transaction_open release_savepoint(savepoint_name) if savepoint_open end Best regards, Laas
2007 Feb 28
12
Specifying that code is called in a block
Not sure if this is possible currently. I have a section of code like this: ActiveRecord::Base.transaction do cow.save! duck.save! dog.save! end (Names changed to protect the innocent.) I''d like to specify that the saves run in a transaction. I can do ActiveRecord::Base.should_receive(:transaction).and_yield But is there any way to specify that the code is
2006 Apr 03
4
How to fake composite primary keys?
I know ActiveRecord doesn''t support composite primary keys, but I need to use one, and I need it ASAP. I don''t need any composite foreign keys, luckily; what I have is a table that stores old versions of rows in another table, so the composite key is an id + date stamp. Would someone tell me a hack I can use to support this? -- View this message in context:
2006 Sep 18
1
SQLServer adapter fails to commit on save()
..., but the record doesn''t appear in the the table according to the SQL Server Management Console. If I do similar in IRB, it does appear. Using the SQL Server profiler I see the line "IF @@TRANCOUNT > 0 COMMIT TRAN" for IRB, but not my test. If I add "report.connection.commit_db_transaction()" after report.save the record does appear. Although I never ask for transactions, it is turning on "implicit_transactions" in SQLServer (in my test and IRB), but somehow the commit is never happening. Thanks for any assistance. Regards, Gary -- Posted via http://www.rub...
2006 Aug 10
6
save without commit ?
...have tried: ActiveRecord::Base.connection.begin_db_transaction # do some stuff that doesn''t issue a database COMMIT statement # then: @myObject.save # this issues a COMMIT but it shouldn''t! Shouldn''t it wait until I''ve called: ActiveRecord::Base.connection.commit_db_transaction ? what am I doing wrong? thanks for any help -- Posted via http://www.ruby-forum.com/.
2006 Oct 01
11
Mongrel woes fixed
Hello all, For the past couple of weeks I have been spending some time debugging a couple of issues I was having with Mongrel when I put load on it. I have seen two distinct issues: 1. Mongrel stopped responding as if in an endless loop. 2. Mongrel crashed when severely loaded. I believe to have resolved these two issues and have attached patches which shows the resolution (simple as it is).