Fast Object Database for Java - with JPA/JDO support

Issue #412: Can't open replicated database

Type: Bug reoprtVersion: 1.4.0Priority: NormalStatus: ActiveReplies: 8

I have a database running in server mode on port 6136 on server1 and server2. Each server has a replicated copy of the other servers database.

I try to open the replicated on one database for a query (just read, no update) but it fails with the error below. The code I'm using is (user & password has been deliberately removed):

EntityManagerFactory emf = Persistence.createEntityManagerFactory(

EntityManager em = emf.createEntityManager();

The exception is thrown by the createEntityManager call.

The exception is:

[ObjectDB 2.2.8] javax.persistence.PersistenceException
Attempt to update types in read only mode (error 614)
at com.objectdb.jpa.EMF.createEntityManager(
at rbccm.felix.gridservice.admin.dao.ConnectionManagerFactory.createEntityManager(Unknown Source)
at rbccm.felix.gridservice.admin.dao.SimpleWorkflowInstanceQueryDao.queryInstance(Unknown Source)
at rbccm.felix.gridservice.admin.dao.SimpleWorkflowInstanceQueryDao.queryComplete(Unknown Source)
at rbccm.felix.gridservice.admin.AdminQueryService.process(Unknown Source)
at Source)
Caused by: com.objectdb.o.UserException: Attempt to update types in read only mode
at com.objectdb.o.MSG.d(
at com.objectdb.o.SHN.ab(
at com.objectdb.o.SHN.J(
... 1 more

On further investigation it looks like this may be related to the initial empty state of the database. I inserted a few rows into the databases and still got the error but when I restarted the objectdb servers and the application clients it seems to be working ok.


On further further investigation I'm still seeing the problem but I'm not having much joy replicating the exact circumstances which cause it. I'll send an update if I can track it down but if ther's any insight you can provide in the meantime it'd be much appreciated!


Not sure if its related but I'm also getting the following null pointer exception

[2011-07-23 17:38:51 #14 *]
at com.objectdb.o.MST.US(
at com.objectdb.o.WRA.US(
at com.objectdb.o.WSM.US(
at com.objectdb.o.QRR.g(
at com.objectdb.o.QRR.b(
at com.objectdb.jpa.JpaQuery.getSingleResult(
at rbccm.felix.objectdb.messaging.ObjectDbMessagePipe.getMessage(Unknown Source)
at rbccm.felix.objectdb.messaging.ObjectDbMessagePipe.take(Unknown Source)
at rbccm.felix.objectdb.messaging.ObjectDbMessagePipe.take(Unknown Source)
at Source)

The first stack trace indicates an attempt to update a type schema in the replicated database, which is read only. This happens automatically if you try to access the replicated database with new or modified classes that are unknown yet in the database (therefore, with an almost empty database this is more likely to happen frequently).

It is unclear if the other exception is related.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Ok, that would explain it. Is there any way around this, i.e. can it tell that a replicated database is being used and not touch the schema?

I guess I can catch the exception and skip the query as I'll know the database is empty but this would be a bit messy as it is defined by UserException + message text.

I think the second stack trace is closer related to the other issue I posted (Issue 58) so I'll continue that discussion on that thread.


Yes, this should be fixed in one of the next builds.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Any idea when this will be fixed?


No immediate fix is currently planned.

The workaround is to make sure that every new (or modified) type is first registered with the master database, e.g. by running a query that uses that type against the master database.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply