That did not work. How about this?
This commit is contained in:
parent
d6ef55d465
commit
a9c3f7448a
@ -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(); }
|
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.
|
// Used in the MongoDB mstore driver.
|
||||||
private WriteConcern mongoDbWriteConcern = WriteConcern.ACKNOWLEDGED;
|
private boolean catchingMongoDbErrorsOnSave = true;
|
||||||
public WriteConcern getMongoDbWriteConcern() { return this.mongoDbWriteConcern; }
|
public boolean isCatchingMongoDbErrorsOnSave() { return this.catchingMongoDbErrorsOnSave; }
|
||||||
public void setMongoDbWriteConcern(WriteConcern mongoDbWriteConcern) { this.mongoDbWriteConcern = mongoDbWriteConcern; this.changed(); }
|
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
|
// HELP ACCESS
|
||||||
|
@ -169,7 +169,7 @@ public class DriverMongo extends DriverAbstract
|
|||||||
|
|
||||||
GsonMongoConverter.gson2MongoObject(data, dbo);
|
GsonMongoConverter.gson2MongoObject(data, dbo);
|
||||||
|
|
||||||
dbcoll.save(dbo, MCoreConf.get().getMongoDbWriteConcern());
|
dbcoll.save(dbo, MCoreConf.get().getMongoDbWriteConcernSave());
|
||||||
|
|
||||||
return mtime;
|
return mtime;
|
||||||
}
|
}
|
||||||
@ -178,7 +178,7 @@ public class DriverMongo extends DriverAbstract
|
|||||||
public void delete(Coll<?> coll, String id)
|
public void delete(Coll<?> coll, String id)
|
||||||
{
|
{
|
||||||
DBCollection dbcoll = fixColl(coll);
|
DBCollection dbcoll = fixColl(coll);
|
||||||
dbcoll.remove(new BasicDBObject(ID_FIELD, id), MCoreConf.get().getMongoDbWriteConcern());
|
dbcoll.remove(new BasicDBObject(ID_FIELD, id), MCoreConf.get().getMongoDbWriteConcernDelete());
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------//
|
//----------------------------------------------//
|
||||||
|
Loading…
Reference in New Issue
Block a user