// cause will remove also the cache lock that is needed
|                 // by the passivation, that eventually will remove it.
|
|This is never going to work for the scenario I am trying. It has
|to be gone
|from the cache
|immediately! I added some lines to BMPPersistanceManager.removeEntity() to


Ok this sounds real.  In fact a create should not throw that exception since
the remove was called previously.  The comment sounds like an implementation
decision.  We must be compliant there, simon any idea on how to fix this?

marc

|do this
|and it solved the problem,.. not sure what it will do to the passivation
|system though.
|Do we need some code to identify that a cached entity has been removed(),
|but not
|actually remove it, so the insert of a new entity with the same key can
|proceed?
|
|cheers
|craig
|
|
|
|At 14:36 11/01/01, Craig Day wrote:
|>Before I start shouting "CRIITICAL BUG" is there anything I should check
|>in relation
|>to configuration of jboss that may cause the problem:
|>
|>The following code snippet inside the stateless session bean
|>SimpleSessionBean:
|>
|>System.out.println("Looking up referance");
|>Object ref  = jndiContext.lookup("CategoryBean");
|>System.out.println("Got reference");
|>CategoryHome home = (CategoryHome)
|>     PortableRemoteObject.narrow (ref, CategoryHome.class);
|>
|>Category cat = home.create("xxx");
|>System.out.println(cat.getCategoryID());
|>cat.remove();
|>home.create("xxx");
|>
|>produces the following error in jBoss (latest CVS)
|>
|>[Default] JBoss PRE-2.1 Started
|>[SimpleSessionBean] Got context
|>[SimpleSessionBean] Looking up referance
|>[SimpleSessionBean] Got reference
|>[CategoryBean] CategoryBean: in setEntityContext()
|>[CategoryBean] CategoryBean: in ejbCreate()
|>[CategoryBean] CategoryBean: in ejbPostCreate()
|>[SimpleSessionBean] xxx
|>[CategoryBean] CategoryBean: in ejbRemove()
|>[CategoryBean] CategoryBean: in setEntityContext()
|>[CategoryBean] CategoryBean: in ejbCreate()
|>[CategoryBean] TRANSACTION ROLLBACK EXCEPTION:null; nested exception is:
|>         javax.ejb.EJBException
|>[CategoryBean] java.lang.IllegalStateException: INSERTING AN ALREADY
|>EXISTING BEAN, ID = xxx
|>[CategoryBean]  at
|>org.jboss.ejb.plugins.AbstractInstanceCache.insert(AbstractInstanc
eCache.java:205)
|>[CategoryBean]  at
|>org.jboss.ejb.plugins.BMPPersistenceManager.createEntity(BMPPersis
tenceManager.java:165)
|>[CategoryBean]  at
|>org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:441)
|>[CategoryBean]  at java.lang.reflect.Method.invoke(Native Method)
|>[CategoryBean]  at
|>org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(Enti
tyContainer.java:639)
|>[CategoryBean]  at
|>org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(
EntitySynchronizationInterceptor.java:160)
|>[CategoryBean]  at
|>org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityI
nstanceInterceptor.java:87)
|>[CategoryBean]  at
|>org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT
|.java:135)
|>[CategoryBean]  at
|>org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInter
ceptorCMT.java:263)
|>[CategoryBean]  at
|>org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT
|.java:86)
|>[CategoryBean]  at
|>org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInter
ceptor.java:125)
|>[CategoryBean]  at
|>org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:106)
|>[CategoryBean]  at
|>org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:316)
|>[CategoryBean]  at
|>org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(
JRMPContainerInvoker.java:404)
|>[CategoryBean]  at
|>org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:198)
|>[CategoryBean]  at $Proxy4.create(Unknown Source)
|>[CategoryBean]  at site.SimpleSessionBean.doit(SimpleSessionBean.java:59)
|>
|>with the following deployment descriptor:
|>
|><ejb-jar>
|>     <enterprise-beans>
|>         <entity>
|>                     <description>Models a Category</description>
|>                     <ejb-name>CategoryBean</ejb-name>
|>                     <home>site.CategoryHome</home>
|>                     <remote>site.Category</remote>
|>                     <ejb-class>site.CategoryBean</ejb-class>
|>                     <persistence-type>Bean</persistence-type>
|>                     <prim-key-class>java.lang.String</prim-key-class>
|>                     <transaction-type>Container</transaction-type>
|>                     <reentrant>true</reentrant>
|>             </entity>
|>
|>         <session>
|>                 <description>A Simple Session Bean</description>
|>                 <ejb-name>SimpleSessionBean</ejb-name>
|>                 <home>site.SimpleSessionHome</home>
|>                 <remote>site.SimpleSession</remote>
|>                 <ejb-class>site.SimpleSessionBean</ejb-class>
|>                 <session-type>Stateless</session-type>
|>                 <transaction-type>Container</transaction-type>
|>         </session>
|>
|>         <container-transaction>
|>             <method>
|>                 <ejb-name>SimpleSessionBean</ejb-name>
|>                 <method-name>*</method-name>
|>             </method>
|>             <trans-attribute>Required</trans-attribute>
|>         </container-transaction>
|>
|>     </enterprise-beans>
|></ejb-jar>
|>
|>
|>
|>--
|>--------------------------------------------------------------
|>To subscribe:        [EMAIL PROTECTED]
|>To unsubscribe:      [EMAIL PROTECTED]
|>List Help?:          [EMAIL PROTECTED]
|>
|
|
|


Reply via email to