Just the basics: I am using DataNucleus, supported by the built-in DB4O database.
If I do this simple test:
PersistenceManager pm1 = persistenceManagerFactory.getPersistenceManager();
PersistenceManager pm2 = persistenceManagerFactory.getPersistenceManager();
pm1.makePersistent(t1);
pm2.makePersistent(t2);
I get a file lock exception:
com.db4o.ext.DatabaseFileLockedException: C:\<path>\primary_datastore.data
Which tells me that I don’t know how it should work PersistenceManager. I thought I just called PersistenceManagerFactorywhenever I needed PersistenceManagerto query or save data, and I would get something thread safe.
- Does PersistenceManager need to do a singleton through my entire expression?
- How to make multiple threads, query execution and updates work in JDO / DataNucleus?
source
share