The following exception was thrown when my app attempted to flush an objectdb database:
Caused by: rbccm.felix.framework.ApplicationException: Error flushing graph container at rbccm.felix.objectdb.workflow.ObjectDbGraphContainer.flush(Unknown Source) at rbccm.felix.objectdb.workflow.ObjectDbGraphContainer.<init>(Unknown Source) at rbccm.felix.objectdb.workflow.ObjectDbGraphContainer.<init>(Unknown Source) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100) ... 32 more Caused by: com.objectdb.o.InternalException: Unexpected internal exception at com.objectdb.o.JPE.h(JPE.java:163) at com.objectdb.o.ERR.f(ERR.java:69) at com.objectdb.o.OBC.onObjectDBError(OBC.java:1485) at com.objectdb.jpa.JpaQuery.executeUpdate(JpaQuery.java:737) ... 40 more Caused by: java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at com.objectdb.o.SEM.c(SEM.java:77) at com.objectdb.o.PBI.q(PBI.java:98) at com.objectdb.o.OBI.Vi(OBI.java:236) at com.objectdb.o.BQI.Vr(BQI.java:144) at com.objectdb.o.PRG.ah(PRG.java:875) at com.objectdb.o.PRG.ad(PRG.java:607) at com.objectdb.o.PRG.ac(PRG.java:536) at com.objectdb.o.QRM.U4(QRM.java:259) at com.objectdb.o.MST.U4(MST.java:947) at com.objectdb.o.WRA.U4(WRA.java:290) at com.objectdb.o.WSM.U4(WSM.java:113) at com.objectdb.o.QRR.g(QRR.java:232) at com.objectdb.o.QRR.b(QRR.java:151) at com.objectdb.jpa.JpaQuery.executeUpdate(JpaQuery.java:722) ... 40 more
The code at this point is performing a delete query for all entity objects that the database contains:
EntityManager em = _emf.createEntityManager(); em.getTransaction().begin(); try { Query query = em.createQuery("DELETE FROM ExecutionGraph g"); query.executeUpdate(); query = em.createQuery("DELETE FROM WorkflowInstance w"); query.executeUpdate(); query = em.createQuery("DELETE FROM TaskInstance t"); query.executeUpdate(); query = em.createQuery("DELETE FROM TaskNode n"); query.executeUpdate(); em.getTransaction().commit(); } catch(Exception e) { if(em.getTransaction().isActive()) em.getTransaction().rollback(); throw new ApplicationException("Error flushing graph container", e); } finally { em.close(); }
I've not had any problems with this operation before today. Looking at the database in explorer it looks like some of the "WorkflowInstance" objects have failed to persist (explorer lists an exception message rather than the object).
The following error message from my application monitor seems to be related but unfortunately I dont have a full stack trace as the app went into a commit retry loop which blew out the logs:
Attempt to commit a transaction after failure in writing to database file 'F:\calculationservice\objectdb\dbs\workflow\uatsrtlonw342-WSAgent-1-Graphs.odb'
I've uploaded the database in question and the objectdb logfile via ftp in case it can shed any additional light on the problem. The filename is ArrayIndexOutOfBoundsException.zip
I appreciated that this may not be enough information to go on - if that is the case feel free to close the issue until I can recreate in a controlled environment.