Revision 55359
Added by Alessia Bardi about 5 years ago
MDStoreTransactionManagerImpl.java | ||
---|---|---|
663 | 663 |
final FindIterable<DBObject> it = transaction.find().noCursorTimeout(true); |
664 | 664 |
for (DBObject currentObj : it) { |
665 | 665 |
final String id = (String) currentObj.get("id"); |
666 |
DBObject newObj = new BasicDBObject(currentObj.toMap()); |
|
666 |
BasicDBObject newObj = (BasicDBObject)((BasicDBObject) currentObj).copy(); |
|
667 |
//Must not have _id in the new object |
|
668 |
newObj.remove("_id"); |
|
667 | 669 |
//setting to journaled write concern to be sure that when the write returns everything has been flushed to disk (https://docs.mongodb.org/manual/faq/developers/#when-does-mongodb-write-updates-to-disk) |
668 | 670 |
//the explicit fsync command can't be run anymore: 'Command failed with error 13: 'fsync may only be run against the admin database.' |
669 | 671 |
final MongoCollection<DBObject> mdstoreWrite = mdstore.withWriteConcern(WriteConcern.JOURNALED); |
Also available in: Unified diff
Fixed transaction commit for _id