This would be dropped the isolation level to the previous isolation level after the transaction is committed/rollback.
Adding this would be able to get some reduced locking as suggested in #1650930: Use READ COMMITTED by default for MySQL transactions and apply it to scenarios where the implementation it can handle the lesser constraints. As with all transaction levels it guarantees the minimum isolation not the maximum and implementations (e.g. sqlite) can escalate the isolation level above that specified.
I need it to improve #2222635-16: Waiting for table metadata lock on cache_field table and will attempt to write it within the next few weeks.
I also plan on supporting postgresql extensions as like a options['pgsql'] or similar argument to db_transaction.
So interface would be:
function db_transaction($name = NULL, array $options = array(), $isolation_level = NULL, $tx_options=array());
The $isolation_level will be able to take a constant Database::ISOLATION_READ_UNCOMMITTED , ISOLATION_READ_COMMITTED, ISOLATION_REPEATABLE_READ, ISOLATION_SERIALIZABLE.
Comment | File | Size | Author |
---|---|---|---|
#1 | db-trans.patch | 15.33 KB | danblack |
Comments
Comment #1
danblack CreditAttribution: danblack commentedstill work in progress. better tests are still just rough.
Comment #2
danblack CreditAttribution: danblack commentedComment #3
mgiffordSetting this as unassigned may help other folks feel they can look at it.
Comment #11
geek-merlinThis approach makes a lot of sense to me.
Comment #12
andypostWhy extra argument when $options passed already
It is more BC