Details
-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
JBossAS-3.2.7 Final, JBossAS-4.0.1 SP1
-
None
-
Medium
-
Workaround Exists
-
Description
Consider the following Entity EJB, BMP:
public class MyEntity
implements EntityBean
{
private EntityContext context;
public MyEntity()
{
}
// From local bean interface
public void doSomething()
public void setEntityContext(EntityContext P_context)
{ context = P_context; }public void unsetEntityContext()
{ context = null; }public void ejbActivate() {}
public void ejbPassivate() {}
public Integer ejbFindByPrimaryKey(Integer Pi_id)
throws FinderException
public Integer ejbCreate(Integer Pi_id)
throws CreateException
public void ejbPostCreate(Integer Pi_id) {}
public void ejbRemove()
throws RemoveException
public void ejbLoad()
{ // Select from database // Causes recursion - always context.getEJBLocalObject().doSomething(); }public void ejbStore()
{ // Update in database // Causes recursion - depending on transaction attributes and readonly/read-write context.getEJBLocalObject().doSomething(); }}
According to the EJB spec 2.0 it should be allowed to use EJBObject/EJBLocalObject during ejbLoad()/ejbStore(). If so this does not work on JBoss as a recursion is produced by the EntitySynchronizationInterceptor#invoke(Invocation) when checking against EnterpriseContext#isValid().