Thank you for the test application.
Strangely, we get different results:
1/23/2016 15:38:42.3842: INFO : (AppPropertyManager.java:144 thread:main): setInitialLoggerSettings(): Reconfiguration of log4j completed.
1/23/2016 15:38:42.3842: INFO : (AppMain.java:34 thread:main): main(): Java version used:1.8.0_66x32
1/23/2016 15:38:42.3842: INFO : (AppMain.java:35 thread:main): main(): PA3 Application start loading...
1/23/2016 15:38:43.3843: INFO : (AppPropertyManager.java:163 thread:AWT-EventQueue-0): setInitialImportLoggerSettings(): Reconfiguration of log4j for import to initial setting completed.
1/23/2016 15:38:43.3843: INFO : (AppCore.java:139 thread:AWT-EventQueue-0): start(): PA3 Application loading completed...
1/23/2016 15:40:23.4023: INFO : (AppDataStoreManager.java:242 thread:Thread-6): doOpenDataStore(): openDataStore: D:\odb\files\anritsu\T1792 Slow Open.odb.pa3
1/23/2016 15:40:24.4024: INFO : (AppDataStoreManager.java:257 thread:Thread-6): doOpenDataStore(): openDataStore took [624] ms
1/23/2016 15:42:31.4231: INFO : (AppCore.java:484 thread:AWT-EventQueue-0): onAppClose(): Pa3 application onAppClose(): Start
1/23/2016 15:42:31.4231: INFO : (AppDataStoreManager.java:82 thread:AWT-EventQueue-0): closeDataStore(): Close Pa3 datastore
1/23/2016 15:42:31.4231: INFO : (Pa3Utils.java:288 thread:AWT-EventQueue-0): interruptApplication(): PA3 Application was successfully closed.
1/23/2016 15:42:35.4235: INFO : (AppPropertyManager.java:144 thread:main): setInitialLoggerSettings(): Reconfiguration of log4j completed.
1/23/2016 15:42:35.4235: INFO : (AppMain.java:34 thread:main): main(): Java version used:1.8.0_66x32
1/23/2016 15:42:35.4235: INFO : (AppMain.java:35 thread:main): main(): PA3 Application start loading...
1/23/2016 15:42:36.4236: INFO : (AppPropertyManager.java:163 thread:AWT-EventQueue-0): setInitialImportLoggerSettings(): Reconfiguration of log4j for import to initial setting completed.
1/23/2016 15:42:36.4236: INFO : (AppCore.java:139 thread:AWT-EventQueue-0): start(): PA3 Application loading completed...
1/23/2016 15:42:47.4247: INFO : (AppDataStoreManager.java:242 thread:Thread-6): doOpenDataStore(): openDataStore: D:\odb\files\anritsu\T1792 Slow Open.odb.pa3
1/23/2016 15:42:48.4248: INFO : (AppDataStoreManager.java:257 thread:Thread-6): doOpenDataStore(): openDataStore took [594] ms
1/23/2016 15:55:48.5548: INFO : (AppCore.java:484 thread:AWT-EventQueue-0): onAppClose(): Pa3 application onAppClose(): Start
1/23/2016 15:55:48.5548: INFO : (AppDataStoreManager.java:82 thread:AWT-EventQueue-0): closeDataStore(): Close Pa3 datastore
i.e. about 600ms rather than 3 seconds (on a 4 years old i3 based computer).
We also tried the following simple test (with your persistent classes in the classpath):
import javax.persistence.*;
public class T1792 {
public static void main(String[] args) {
String path = "temp.odb";
for (int i = 0; i < 10; i++)
{
long ms = System.currentTimeMillis();
EntityManagerFactory emf =
Persistence.createEntityManagerFactory(path);
EntityManager em = emf.createEntityManager();
ms = System.currentTimeMillis() - ms;
System.out.println("Open " + path + " time: " + ms);
em.close();
emf.close();
path = "objectdb:D:\\odb\\files\\anritsu\\T1792 Slow Open.odb.pa3";
}
}
}
and the results are:
Open temp.odb time: 493
Open objectdb:D:\odb\files\anritsu\T1792 Slow Open.odb.pa3 time: 94
Open objectdb:D:\odb\files\anritsu\T1792 Slow Open.odb.pa3 time: 23
Open objectdb:D:\odb\files\anritsu\T1792 Slow Open.odb.pa3 time: 26
Open objectdb:D:\odb\files\anritsu\T1792 Slow Open.odb.pa3 time: 27
Open objectdb:D:\odb\files\anritsu\T1792 Slow Open.odb.pa3 time: 30
Open objectdb:D:\odb\files\anritsu\T1792 Slow Open.odb.pa3 time: 24
Open objectdb:D:\odb\files\anritsu\T1792 Slow Open.odb.pa3 time: 42
Open objectdb:D:\odb\files\anritsu\T1792 Slow Open.odb.pa3 time: 27
Open objectdb:D:\odb\files\anritsu\T1792 Slow Open.odb.pa3 time: 22
These results show that opening your specific database takes less than 100 milliseconds (excluding loading of ObjectDB into the JVM, which is done in this test before opening your database file, by creating another temporary database file).
Try to load ObjectDB in the background (e.g. by opening a temporary database file as in the test above) and see if later it helps in speeding up the opening of your database.
Regarding your new profiling info at #14, please try running the following code on your computer (e.g. as a simple console application):
Enumeration e = NetworkInterface.getNetworkInterfaces();
while (e.hasMoreElements()) {
NetworkInterface ni = (NetworkInterface)e.nextElement();
byte[] hardwareAddress = ni.getHardwareAddress();
}
If takes more than a few milliseconds on your machine then maybe this is the cause.
Another thing to check, if you use XML to define JPA/JDO entity/persistence capable classes, check the XML header, since sometimes XML validation requires searching the Internet.