Annonceindlæg fra Computerworld it-jobbank
10. september 2003 - 14:00
#3
godt nok et tænkt eksempel for i mit tilfælde laver jeg nærmere et Account1.create(navn,.....,.....); //LYKKEDES Account2.create(navn,.....,.....); //LYKKEDES IKKE som ikke kan ligges på databasen da primærnøglen allerede er brugt
10. september 2003 - 14:16
#7
13:05:14,576 INFO [STDOUT] OPRETTER ORDRE 157 13:05:14,576 INFO [STDOUT] OPRETTER ORDRELINIER 1 13:05:14,576 ERROR [STDERR] javax.ejb.DuplicateKeyException: Entity with primary key 1 already exists 13:05:14,576 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEntityCommand.java:128) 13:05:14,576 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:527) 13:05:14,576 ERROR [STDERR] at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:253) 13:05:14,586 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:270) 13:05:14,586 ERROR [STDERR] at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:580) 13:05:14,586 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor498.invoke(Unknown Source) 13:05:14,586 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 13:05:14,586 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324) 13:05:14,616 ERROR [STDERR] at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1119) 13:05:14,616 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73) 13:05:14,616 ERROR [STDERR] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:207) 13:05:14,616 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215) 13:05:14,626 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73) 13:05:14,626 ERROR [STDERR] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:91) 13:05:14,626 ERROR [STDERR] at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79) 13:05:14,626 ERROR [STDERR] at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44) 13:05:14,626 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111) 13:05:14,626 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:237) 13:05:14,626 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:68) 13:05:14,626 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105) 13:05:14,626 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:133) 13:05:14,626 ERROR [STDERR] at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487) 13:05:14,636 ERROR [STDERR] at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:230) 13:05:14,636 ERROR [STDERR] at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110) 13:05:14,636 ERROR [STDERR] at $Proxy764.create(Unknown Source) 13:05:14,636 ERROR [STDERR] at global.OrdreControllerBean.opretOrdre(OrdreControllerBean.java:68) 13:05:14,636 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 13:05:14,636 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 13:05:14,636 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 13:05:14,636 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324) 13:05:14,636 ERROR [STDERR] at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:824) 13:05:14,636 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130) 13:05:14,636 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186) 13:05:14,646 ERROR [STDERR] at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:268) 13:05:14,646 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107) 13:05:14,646 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:237) 13:05:14,646 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:98) 13:05:14,646 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:208) 13:05:14,646 ERROR [STDERR] at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java:380) 13:05:14,646 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:738) 13:05:14,646 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517) 13:05:14,646 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:383) 13:05:14,646 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source) 13:05:14,646 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 13:05:14,656 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324) 13:05:14,656 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261) 13:05:14,656 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.java:148) 13:05:14,656 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method) 13:05:14,656 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Transport.java:144) 13:05:14,656 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460) 13:05:14,656 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701) 13:05:14,656 ERROR [STDERR] at java.lang.Thread.run(Thread.java:536) 13:05:14,666 ERROR [LogInterceptor] EJBException: javax.ejb.EJBException: Transaction failed: Entity with primary key 1 already exists at global.OrdreControllerBean.opretOrdre(OrdreControllerBean.java:159) 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.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:824) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186) at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:268) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:237) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:98) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:208) at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java:380) at org.jboss.ejb.Container.invoke(Container.java:738) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517) at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:383) at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source) 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:536)