You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rails 6 will add lazy transactions, wherein a call to ActiveRecord::Base.transaction won’t cause a BEGIN statement to be sent to the DBMS until the first read or write. If no read or write occurs inside the transaction block, no COMMIT statement is sent, either. The benefit of this change is that a call to ActiveRecord::Base#save which doesn’t result in any queries (for example, because the record’s attributes didn’t change) won’t incur an empty transaction.
But Makara sticks to the primary for the remainder of a request after the first call to ActiveRecord::Base.transaction, even if no DB transaction actually occurs. Ideally, Makara would wait for the BEGIN to stick to the primary.
The text was updated successfully, but these errors were encountered:
That's cool. It sounds like as you say, BEGIN and COMMIT should trigger the same transaction code that the .transaction block does now. Maybe we should stop doing the block altogether or maybe we should have a Rails version check.
Rails 6 will add lazy transactions, wherein a call to
ActiveRecord::Base.transaction
won’t cause aBEGIN
statement to be sent to the DBMS until the first read or write. If no read or write occurs inside the transaction block, noCOMMIT
statement is sent, either. The benefit of this change is that a call toActiveRecord::Base#save
which doesn’t result in any queries (for example, because the record’s attributes didn’t change) won’t incur an empty transaction.But Makara sticks to the primary for the remainder of a request after the first call to
ActiveRecord::Base.transaction
, even if no DB transaction actually occurs. Ideally, Makara would wait for theBEGIN
to stick to the primary.The text was updated successfully, but these errors were encountered: