MVCC: Managing Conflicts

来源:互联网 发布:碗莲的种植方法淘宝 编辑:程序博客网 时间:2024/06/10 03:35


When the MVCC transaction manager is used, all transactions are executed concurrently Sometimes concurrent transactions modify the same objects, thus creating transaction conflicts.
 The transaction manager resolves those conflicts by aborting one of the conflicting transactions and letting the other one commit its updates.
• Applications should manage MCO_E_CONFLICT return code:
do { mco_trans_start( db, MCO_READ_WRITE, MCO_TRANS_FOREGROUND, &t);
...<update database>...
rc = mco_trans_commit(t);
} while ( rc == MCO_E_CONFLICT );
 If the number of conflicts is too high, the transaction manager temporarily turns the optimistic control off and continues scheduling database transactions using the pessimistic approach.

0 0
原创粉丝点击