jsr345-experts@ejb-spec.java.net

[jsr345-experts] Re: Non-reentrant instances and getBusinessObject

From: Marina Vatkina <marina.vatkina_at_oracle.com>
Date: Fri, 30 Sep 2011 12:59:21 -0700

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