Hi,
The problem I have comes originally from the fact that I use
ctx.getEJBObject() to get, inside an Entity Bean, the Remote Interface
itself to send it as a parameter of a finder method of another EntityBean
linked to it by a field where I store this Remote Interface.
Breathe ;)
Please read this as for me there is a bug somewhere.
My problem (running latest CVS, HSQL, CMP) :
1. find on Entity Bean DATA
2. Call USER.GETTHING
This method calls ctx.getEJBObject() and receive "USERCTX"
Then do something with this EJBObject.
3. Call USERNEW=USERHOME.CREATE()
Here EntityContainer.createHome is called
This calls createEntity by giving him mi.getEnterpriseContext()
This is set in EntityInstanceInterceptor.invokeHome()
By Calling AbstractInstancePool.get()
The EnterpriseContext attached to USERNEW is the same as for USER
because
free() has been called which has re-put the EnterpriseContext in the stack.
Then CMPPersistenceManager make a ctx.setEJBObject and because ctx is
the
home of USER, change ejbObject of USER with the value of USERNEW
! THAT IS MY PROBLEM !
4. find on Entity Bean USER
5. Call USER.GETTHING
This method calls ctx.getEJBObject() and receive "USERNEWCTX"
! Aarrrrghhhh !
The ctx of USER is different of the ctx of USERNEW which is fine.
The problem is on the ejbObject inside ctx.
Again breathe.
Am I clear ? (it is not really clear for me).
My Solution :
In AbstractInstancePool :
public synchronized void free(EnterpriseContext ctx)
{
// Pool it
//DEBUG Logger.debug("Free
instance:"+ctx.getId()+"#"+ctx.getTransaction());
ctx.clear();
/** DO NOT RE_PUT THE CTX IN THE STACK BUT ALWAYS DISCARD IT
* if (pool.size() < maxSize)
* {
* pool.push(ctx);
* } else
* {
*/
discard(ctx);
/**
}
*/
}
I do not think my solution is THE solution but only a work around. But
really I have to confess it's still too hard for me to get the whole picture
to be able to correct it.
Vincent.
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development