ObjectDb.conf Defaults

#1

Is it expected that all objectdb.conf entries are optional and when they are not provided defaults are used?  It appears that that is the case for all documented entries, except for 4 entries under "General".

<objectdb>
<general>
  <!-- error if missing <temp path="$temp/ObjectDb" threshold="64mb" /> -->
  <!-- error if missing <network inactivity-timeout="0" /> -->
  <!-- ok if missing <url-history size="0" user="false" password="false" /> -->
  <!-- error if missing <log path="" max="8mb" stdout="false" stderr="false" /> -->
  <!-- error if missing <log-archive path="$objectdb/log/archive/" retain="90" /> -->
  <!-- ok if missing <logger name="*" level="info" /> -->
</general>
</objectdb>

 

import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Properties;
public class Test{
    public static void main(String[] args){
        String currentDirectory = System.getProperty("user.dir", ".");
        System.out.format("Current Directory:  %s%n", currentDirectory);
        Path objectDbConFile = Paths.get(currentDirectory, "objectdb.conf");
        if(Files.exists(objectDbConFile)) System.out.println("objectdb.config FOUND"); else System.out.println
            ("objectdb.config NOT found");
        System.setProperty("objectdb.home", currentDirectory); // Sets %objectdb environment variable
        System.setProperty("objectdb.conf", objectDbConFile.toString());
        Properties properties = new Properties();
        properties.setProperty("javax.jdo.PersistenceManagerFactoryClass", "com.objectdb.jdo.PMF");
        properties.setProperty("javax.jdo.option.ConnectionURL", "$objectdb/local.odb");
        PersistenceManagerFactory persistenceManagerFactory = JDOHelper.getPersistenceManagerFactory(properties);
        PersistenceManager persistenceManager = persistenceManagerFactory.getPersistenceManager();
        persistenceManager.close();
        persistenceManagerFactory.close();
    }
}
#2

> Is it expected that all objectdb.conf entries are optional?

No. Some settings are required in a valid objectdb.conf file (although the objectdb.conf file itself is optional). This may change in future versions of ObjectDB.

ObjectDB Support
#3

> Is it expected that all objectdb.conf entries are optional?

No. Some settings are required in a valid objectdb.conf file (although the objectdb.conf file itself is optional). This may change in future versions of ObjectDB.

ObjectDB Support

Reply