代码拉取完成,页面将自动刷新
A MongoDB java driver, with MVCC. So, you can use it to perform Transaction Transactional with your code
PS: in the newest version, we can perform a "distributed transaction"
contact me (mail:11509923@qq.com) if you have interesting.
db.XX.update({}, {$set:{__s_.__s_stat: 2, __s_.__s_g_time:Long.MAX_VALUE,__s_.__s_c_txid:-1l,__s_.__s_u_txid:-1l})
1)your connection user must can see the DB named “transaction”
2)the user with credential must can [readWrite] DB-“transaction”
4)if your collection already has an uniqueindex.you must:
fisrt drop it,
then recreate it but add a field named "unique_" to the index.
i.e.: consider Collection A has uniqueindex that name="test", field="aaaa".
this index should be update to name="test", field="aaaa, unique_".
!!!!OR!!!!YOU CAN CREATE INDEX VIA THIS DRIVER!!!IT WILL AUTOMATIC CREATE THE "unique_" FIELD"
CAUSTIONS:
1)do not support DBRef with _id,because on update will create new temp-obj with new _id;
#Or you can do these operations in your own codes ^_^#
can not use “mongo” label,you should config a <bean id="mongo" class="SidistranMongoClient"> instead
SidistranMongoClient mongo = new SidistranMongoClient(serverAddress, credentials);
MongoTanscationManager tanscationManager = new MongoTanscationManager(mongo);//this is singleton
tanscationManager.begin();//begin a transaction
do_with(mongo);
tanscationManager.commit();//commit it
tanscationManager.close();//you must close the MongoTanscationManager if won't use anymore
mongo.close();
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。