Re: [JBoss-user] using keyword 'this' in EJB?

2001-04-09 Thread Scott M Stark


> 3) pass the entity bean to the helper object via the 'this' keyword. This
> would mean that I dont have to make the bean 'reentrant', and from a
> performance perspective would most likely be the fastest approach. 
> 
> In the 3rd approach, since the entity bean's implementation would only be
> passed to the helper object during an EJB callback method (hence the
> container would inhibit any other concurrent methods calls on the bean), and
> the helper object is a local java object - I'm wondering how this approach
> would interfere with the services that the container provides??
> 
> 
Ok, this is really no different than the bean method's implementation calling
its own methods which is not considered a reentrant call. In this case passing
this is fine.



___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] using keyword 'this' in EJB?

2001-04-09 Thread Crothers.Dean

Scott,

My entity bean has a helper object (just a plain local java object) that
needs to get information about the entity bean. Therefore, to do this I have
a couple of options:
1) get the remote reference from its context and pass it in to the helper
object. As you mentioned though, to do this I'd have to make the bean
reentrant or the loopback call would block - making the bean reentrant is
something I dont want to do.
2) pass a value object between the entity bean and helper object - this
however incurs more object creation.
3) pass the entity bean to the helper object via the 'this' keyword. This
would mean that I dont have to make the bean 'reentrant', and from a
performance perspective would most likely be the fastest approach. 

In the 3rd approach, since the entity bean's implementation would only be
passed to the helper object during an EJB callback method (hence the
container would inhibit any other concurrent methods calls on the bean), and
the helper object is a local java object - I'm wondering how this approach
would interfere with the services that the container provides??


thanks,

Dean

-Original Message-
From: Scott M Stark [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 08, 2001 11:46 PM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] using keyword 'this' in EJB?


> 
> However, in the case when the flow of execution is within the EJB
> implementation (entity), ie in a callback or remote method, is it then ok
to
> pass the bean to other local objects using the 'this' keyword? Whilst the
> flow of execution is within the bean implementation then all other remote
> method invocations will be blocked, hence as long as the bean is passed to
> local objects only then this shouldnt interfere with the beans container?
> 
> I'm guessing that it is ok to do the above, but not recommended?
> 
In general its not ok to do this if the container is managing transactions,
persistance or security as handing out a the ejb implementation object
does not allow the container to handle any method invocation directly
made on the ejb implementation. If you have to do this mark the bean
as reentrant and pass its remote interface. What are you trying to gain by
avoiding this?



___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] using keyword 'this' in EJB?

2001-04-08 Thread Scott M Stark

> 
> However, in the case when the flow of execution is within the EJB
> implementation (entity), ie in a callback or remote method, is it then ok to
> pass the bean to other local objects using the 'this' keyword? Whilst the
> flow of execution is within the bean implementation then all other remote
> method invocations will be blocked, hence as long as the bean is passed to
> local objects only then this shouldnt interfere with the beans container?
> 
> I'm guessing that it is ok to do the above, but not recommended?
> 
In general its not ok to do this if the container is managing transactions,
persistance or security as handing out a the ejb implementation object
does not allow the container to handle any method invocation directly
made on the ejb implementation. If you have to do this mark the bean
as reentrant and pass its remote interface. What are you trying to gain by
avoiding this?



___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user