Marina,
The re-entrant semantics of Singletons were relatively well discussed
and understood. For singletons, instance == 1 in effect, so it's
somewhat moot, so Linda's point would be accurate.
Cheers,
Reza
On 10/10/2011 8:58 PM, Marina Vatkina wrote:
> Reza, Linda,
>
> Was this confirmed or just discussed? The former would contradict 2)
> in Linda's email...
>
> thanks,
> -marina
>
> Reza Rahman wrote:
>> Linda,
>>
>> There was no other discussion of this.
>>
>> Cheers,
>> Reza
>>
>>
>> On 10/10/2011 8:34 PM, Linda DeMichiel wrote:
>>> Hi Marina, all
>>>
>>> Just to clarify....
>>>
>>> What I would expect is that if a subsequent invocation were made on
>>> the result of getBusinessObject, then:
>>>
>>> 1) for a stateless session bean, the invocation would be delivered
>>> to another stateless session bean instance.
>>> 2) for a stateful session bean or singleton session bean, the
>>> invocation
>>> would be delivered to the bean instance that returned the reference.
>>>
>>> The existing rules regarding reentrancy would then apply.
>>>
>>> Was there any discussion of this in EJB 3.1? The only email I can
>>> uncover
>>> seems to imply that for the stateful session bean case the
>>> invocation might
>>> be delivered to a new instance.
>>>
>>> -Linda
>>>
>>>
>>> On 10/10/2011 5:09 PM, Marina Vatkina wrote:
>>>> Coming back to it ... We need to fix both :(.
>>>>
>>>> Our CTS people clarified that "These tests verify the equals
>>>> semantics of client view, including checking equals among
>>>> results from various sessioinContext.getBusinessObject(class) calls."
>>>>
>>>> I also checked with Linda and she confirmed that for the SLSB, any
>>>> instance can be used to execute the call on the
>>>> returned reference. But SFSB and singletons need to be addressed
>>>> explicitly.
>>>>
>>>> Experts,
>>>>
>>>> Please let me know if you agree to add this statement to 4.3.3The
>>>> SessionContext Interface (EJB 3.2 working draft) after
>>>> the existing paragraph:
>>>>
>>>> "The getBusinessObject(Class businessInterface)method returns a
>>>> business object reference to the session bean’s business
>>>> interface or no-interface view. In the case of the no-interface
>>>> view, the argument is of the type of the bean class.
>>>> Only session beans with an EJB 3.x business interface or
>>>> no-interface view are permitted to call this method."
>>>>
>>>> =========
>>>> If a business method is called on such reference from the same
>>>> session bean that called getBusinessObject method, unless
>>>> the bean supports reentrant calls, a container will use a different
>>>> stateless session bean instance either from the pool
>>>> or will create a new instance to serve the request. For the
>>>> stateful session beans and singleton session beans the
>>>> returned reference will be for the same instance, and the bean must
>>>> support reentrant calls to call a method on it.
>>>> =========
>>>>
>>>> thanks,
>>>> -marina
>>>>
>>>>
>>>> Carlo de Wolf wrote:
>>>>> An associated TCK test is com.sun.ts.tests.ejb30.lite.view.equals.
>>>>>
>>>>> Carlo
>>>>>
>>>>> On 09/30/2011 10:55 PM, Carlo de Wolf wrote:
>>>>>> I would certainly hope not that the javadoc is wrong. But I do
>>>>>> agree that the spec only hints at the identity of the
>>>>>> business object returned, the API docs are correct. That needs
>>>>>> more amplification in the spec.
>>>>>>
>>>>>> EJB 3.2 Draft 2011-05-05 16.2.2:
>>>>>> The enterprise bean must not attempt to pass this as an argument
>>>>>> or method result. The
>>>>>> enterprise bean must pass the result of
>>>>>> SessionContext.getBusinessObject, Ses-
>>>>>> sionContext.getEJBObject, SessionContext.getEJBLocalObject, Enti-
>>>>>> tyContext.getEJBObject, or EntityContext.getEJBLocalObject instead.
>>>>>>
>>>>>> Carlo
>>>>>>
>>>>>> On 09/30/2011 09:59 PM, Marina Vatkina wrote:
>>>>>>> I think the javadoc (if you are looking at it) is misleading.
>>>>>>> ctx.getBusinessObject returns you an instance, not
>>>>>>> this instance.
>>>>>>>
>>>>>>> You can even do this inside that bean
>>>>>>>
>>>>>>> @EJB MyLocalView meLocal;
>>>>>>> @EJB MyRemoteView meRemote;
>>>>>>>
>>>>>>> -marina
>>>>>>>
>>>>>>> Carlo de Wolf wrote:
>>>>>>>> In light of EJB 3.2 Draft 2011-05-05 4.10.13 Non-reentrant is
>>>>>>>> the following allowed in a session bean:
>>>>>>>>
>>>>>>>> 1. public String aMethod() { return
>>>>>>>> ctx.getBusinessObject(MyLocalView.class).doSomething(); } ?
>>>>>>>>
>>>>>>>> 2. public String bMethod() { return
>>>>>>>> ctx.getBusinessObject(MyRemoteView.class).doSomething(); } ?
>>>>>>>>
>>>>>>>> Carlo
>>>>>>
>>>>>
>>>
>>>
>>> -----
>>> No virus found in this message.
>>> Checked by AVG - www.avg.com
>>> Version: 2012.0.1831 / Virus Database: 2090/4545 - Release Date:
>>> 10/10/11
>>>
>>>
>>
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2012.0.1831 / Virus Database: 2090/4545 - Release Date: 10/10/11
>
>