CMP/Cacheing problems
timshaw Jul 27, 2004 11:46 AMHi,
I have an app which has infrequent (daily) updates of data, and requires high-speed read-only access by a small number of clients all the time.
I'm not bothered (much) by the speed of loading, but retrieval needs to be as fast as possible.
As all access is via my beans, I initially tried (with commit-option A) just loading the data sequentially (I have a number of test data-sets correesponding to a weeks worth of data). This results in the error below (or some other exception about a primary-key=0).
It turns out that if I run the load sequence twice, it all goes horribly wrong (see trace below) ... but if I stop and restart JBoss in between the two loads it works fine!
I've tried various commit-options (A,B,C), and they seem to make no difference to the outcome.
I've tried flushCache on each of the EJB's after each load sequence ... same problem.
I think this has to be a cacheing problem - mainly because the stop/restart fixes it, which implies it's not my code(?).
Any suggestions gratefully accepted - this is crucial to my company and is not really a difficult domain. All I want to do is load some data, juggle with it a bit and then let others see the results after all!
16:16:22,855 ERROR [LogInterceptor] TransactionRolledbackException in method: public abstract com.blueheath.common.system.CycleStatistics com.blueheath.warehouse.ejb.Loader.loadCycleData(java.lang.Long) throws java.rmi.RemoteException, causedBy: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=tim.direct.local//21, BranchQual=] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.ejb.EJBException: Could insert relations into cusorderitemlineitemrelation; CausedByException is: Duplicate key or integrity constraint violation, message from server: "Duplicate entry '29296-2170' for key 1") at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:415) at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:456) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:324) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:120) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191) at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122) at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331) at org.jboss.ejb.Container.invoke(Container.java:723) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53) at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473) at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:360) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261) at sun.rmi.transport.Transport$1.run(Transport.java:148) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:144) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701) at java.lang.Thread.run(Thread.java:534)