This is a critical update for anyone using
DB_Virtual. I wasn’t passing
$onoff onto the master
DB::autoCommit() function which would effectively break transactions.
Additionally, I was noticing strange behavior when I would do a couple of
INSERT queries and then immediately query for that data set after the transaction had committed. What was happening was that the records were created on the master, but the subsequent
SELECT was going to the slave before they had propagated to the slave. Basically master/slave latency was breaking the
SELECT queries. As a result, I’ve added
DB_Virtual::queryMaster(), which acts just like
DB::query(), so you can query the master node in such situations.
- Fixed a bug in
DB_Virtual::autoCommit()that wasn’t passing $onoff to the master’s
DB_Virtual::queryMaster()so you can send queries directly to the master