Request: support Rails 6 lazy transactions
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.
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.