Doug,

> The pk is fine.. 
> 
> Everything works fine if I create one bean...
> and wait awhile then create another.

How much is 'a while' ? I mean do you wait enough for the cache to passivate
the instance (default is 5 minutes) or it is less than that ?

I was guessing that maybe your ejbCreate has the right SQL (so that the DB
does not complain for duplicate PK), but always returns a PK with the same
value (0, in your case)...

Anyway, if you can put in a simple test case that fails consistently, enter
it as a bug in SourceForge.

Thanks,

Simon

> However, If I try to create 2 within the same minute...
> I get this exception.
> 
> d.
> 
> -----Original Message-----
> From: Bordet, Simone [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 21, 2001 12:51 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: [JBoss-dev] InstanceCache is throwing
> IllegalStateException.. .. id = 0?
> 
> 
> May you double check your ejbCreate returns the right PK ?
> 
> Simon
> 
> > -----Original Message-----
> > From: Ferguson, Doug [mailto:[EMAIL PROTECTED]]
> > Sent: luned� 21 maggio 2001 19:22
> > To: '[EMAIL PROTECTED]'
> > Subject: [JBoss-dev] InstanceCache is throwing 
> > IllegalStateException....
> > id = 0?
> > 
> > 
> > 
> > 
> > Hi,
> > 
> > I posted this to users but I guess it might be too 
> > complicated for those
> > guys...
> > Anybody know whats up with this?
> > 
> > 
> > When I call home.create() for my entity bean it behaves just 
> > fine under
> > normal situations. However if I call home.create() serveral times in
> > succession only the first call will work the others will throw and
> > IllegalStateException. The exception is getting when becuase the
> > InstanceCache object finds the id in it's cache..   Which is 
> > bizarre because
> > the I print out the id and it is unique.  Another thing that 
> > is bizare is
> > the message that comes back from the instant cache indicates 
> > that the id is
> > 0!
> > 
> > Any ideas?
> > 
> > Stack Trace....
> > *******************************************************
> > Login] Found CoreUser interface 
> > [CoreUserBean] TRANSACTION ROLLBACK EXCEPTION:null; nested 
> > exception is: 
> >         javax.ejb.EJBException 
> > [CoreUserBean] java.lang.IllegalStateException: INSERTING 
> AN ALREADY 
> > EXISTING BEAN, ID = 0 
> > [CoreUserBean]  at 
> > org.jboss.ejb.plugins.AbstractInstanceCache.insert(AbstractIns
> > tanceCache.jav
> > a:207) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.plugins.BMPPersistenceManager.createEntity(BMPPe
> > rsistenceManag
> > er.java:165) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:441) 
> > [CoreUserBean]  at java.lang.reflect.Method.invoke(Native Method) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(
> > EntityContaine
> > r.java:639) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeH
> > ome(EntitySync
> > hronizationInterceptor.java:160) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(Ent
> > ityInstanceInt
> > erceptor.java:87) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxIntercepto
> > rCMT.java:135)
> > 
> > [CoreUserBean]  at 
> > org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxI
> > nterceptorCMT.
> > java:263) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxIntercepto
> > rCMT.java:86) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityI
> > nterceptor.jav
> > a:164) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor
> > .java:106) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:316) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeH
> > ome(JRMPContai
> > nerInvoker.java:369) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeH
> > ome(JRMPContai
> > nerInvoker.java:423) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomePro
> > xy.java:212) 
> > [CoreUserBean]  at $Proxy43.create(Unknown Source) 
> > [CoreUserBean]  at 
> > 
> com.coremetrics.security.LoginBean.createCoreUser(LoginBean.java:61) 
> > [CoreUserBean]  at java.lang.reflect.Method.invoke(Native Method) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.i
> > nvoke(Stateles
> > sSessionContainer.java:472) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invo
> > ke(StatelessSe
> > ssionInstanceInterceptor.java:87) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxIntercepto
> > rCMT.java:133)
> > 
> > [CoreUserBean]  at 
> > org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxI
> > nterceptorCMT.
> > java:263) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT
> > .java:99) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInter
> > ceptor.java:19
> > 0) 
> > [CoreUserBean]  at 
> > 
> org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessio
> > nContainer.jav
> > a:271) 
> > [CoreUserBean]  at 
> > org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(
> > JRMPContainerI
> > nvoker.java:392) 
> > [CoreUserBean]  at java.lang.reflect.Method.invoke(Native Method) 
> > [CoreUserBean]  at 
> > sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241) 
> > [CoreUserBean]  at 
> > sun.rmi.transport.Transport$1.run(Transport.java:142) 
> > [CoreUserBean]  at 
> java.security.AccessController.doPrivileged(Native 
> > Method) 
> > [CoreUserBean]  at 
> > sun.rmi.transport.Transport.serviceCall(Transport.java:139) 
> > [CoreUserBean]  at 
> > sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport
> > .java:443) 
> > [CoreUserBean]  at 
> > sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTr
> > ansport.java:6
> > 43) 
> > [CoreUserBean]  at java.lang.Thread.run(Thread.java:484) 
> > 
> >   
> > 
> > 
> > 
> > _______________________________________________
> > Jboss-development mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/jboss-development
> > 
> 
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-development
> 
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-development
> 

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to