Skip to content

Commit

Permalink
Merge pull request #708 from jdgarrett/object-durability-config-fix
Browse files Browse the repository at this point in the history
Also check global config for object_durability config option.
  • Loading branch information
groldan committed Apr 25, 2014
2 parents 3cd6cbe + 8cbca7e commit 604346e
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class JEObjectDatabase extends AbstractObjectDatabase implements ObjectDa

/** Name of the BDB JE Environment inside the .geogit folder used for the objects database */
static final String ENVIRONMENT_NAME = "objects";

private static final Logger LOGGER = LoggerFactory.getLogger(JEObjectDatabase.class);

private static final int SYNC_BYTES_LIMIT = 512 * 1024 * 1024;
Expand All @@ -98,6 +98,8 @@ public class JEObjectDatabase extends AbstractObjectDatabase implements ObjectDa

private static final String BULK_PARTITIONING_CONFIG_KEY = "bdbje.bulkpartition";

private static final String OBJECT_DURABILITY_CONFIG_KEY = "bdbje.object_durability";

private EnvironmentBuilder envProvider;

/**
Expand Down Expand Up @@ -847,7 +849,10 @@ private Transaction newTransaction() {
if (transactional) {
TransactionConfig txConfig = new TransactionConfig();
txConfig.setReadUncommitted(true);
Optional<String> durability = configDB.get("bdbje.object_durability");
Optional<String> durability = configDB.get(OBJECT_DURABILITY_CONFIG_KEY);
if (!durability.isPresent()) {
durability = configDB.getGlobal(OBJECT_DURABILITY_CONFIG_KEY);
}
if ("safe".equals(durability.orNull())) {
txConfig.setDurability(Durability.COMMIT_SYNC);
} else {
Expand Down

0 comments on commit 604346e

Please sign in to comment.