That did not work. How about this?

This commit is contained in:
Olof Larsson 2014-04-05 11:36:51 +02:00
parent d6ef55d465
commit a9c3f7448a
2 changed files with 22 additions and 5 deletions

View File

@ -63,9 +63,26 @@ public class MCoreConf extends Entity<MCoreConf>
public void setDeleteFiles(List<String> deleteFiles) { this.deleteFiles = deleteFiles == null ? new ArrayList<String>() : new ArrayList<String>(deleteFiles); this.changed(); }
// Used in the MongoDB mstore driver.
private WriteConcern mongoDbWriteConcern = WriteConcern.ACKNOWLEDGED;
public WriteConcern getMongoDbWriteConcern() { return this.mongoDbWriteConcern; }
public void setMongoDbWriteConcern(WriteConcern mongoDbWriteConcern) { this.mongoDbWriteConcern = mongoDbWriteConcern; this.changed(); }
private boolean catchingMongoDbErrorsOnSave = true;
public boolean isCatchingMongoDbErrorsOnSave() { return this.catchingMongoDbErrorsOnSave; }
public void setCatchingMongoDbErrorsOnSave(boolean catchingMongoDbErrorsOnSave) { this.catchingMongoDbErrorsOnSave = catchingMongoDbErrorsOnSave; this.changed(); }
private boolean catchingMongoDbErrorsOnDelete = true;
public boolean isCatchingMongoDbErrorsOnDelete() { return this.catchingMongoDbErrorsOnDelete; }
public void setCatchingMongoDbErrorsOnDelete(boolean catchingMongoDbErrorsOnDelete) { this.catchingMongoDbErrorsOnDelete = catchingMongoDbErrorsOnDelete; this.changed(); }
public static WriteConcern getMongoDbWriteConcern(boolean catchingErrors)
{
return catchingErrors ? WriteConcern.ACKNOWLEDGED : WriteConcern.ERRORS_IGNORED;
}
public WriteConcern getMongoDbWriteConcernSave()
{
return getMongoDbWriteConcern(this.isCatchingMongoDbErrorsOnSave());
}
public WriteConcern getMongoDbWriteConcernDelete()
{
return getMongoDbWriteConcern(this.isCatchingMongoDbErrorsOnDelete());
}
// -------------------------------------------- //
// HELP ACCESS

View File

@ -169,7 +169,7 @@ public class DriverMongo extends DriverAbstract
GsonMongoConverter.gson2MongoObject(data, dbo);
dbcoll.save(dbo, MCoreConf.get().getMongoDbWriteConcern());
dbcoll.save(dbo, MCoreConf.get().getMongoDbWriteConcernSave());
return mtime;
}
@ -178,7 +178,7 @@ public class DriverMongo extends DriverAbstract
public void delete(Coll<?> coll, String id)
{
DBCollection dbcoll = fixColl(coll);
dbcoll.remove(new BasicDBObject(ID_FIELD, id), MCoreConf.get().getMongoDbWriteConcern());
dbcoll.remove(new BasicDBObject(ID_FIELD, id), MCoreConf.get().getMongoDbWriteConcernDelete());
}
//----------------------------------------------//