[Design of EJB 3.0] - Re: When is there an EJBObject?
by ALRubinger
I'm not sure the history of our goals in implementation, but taking from the perspective of an application developer:
Isn't the concept of "partially-realized" confusing? An EJB2.1 view that's only callable from a EJB3.0 client? Why?
An EJB should have the following possible views: EJB3.0, EJB2.1, or both, with nothing inbetween. Anything half-defined should throw a descriptive Exception to the bean provider on deploy.
Propose the following:
* Close 1058 as invalid/not a bug
* Fix RemoteUnitTestCase.testEJBObject() to pass by changing org.jboss.ejb3.test.stateful.Stateful to extend EJBObject.
* Open a new issue, redefining the case outlined in 1058 but stipulating that the container should throw an exception on deploy. Remote interface w/ no home is an incomplete 2.1 view.
* Open a new issue for the inverse: Home interface with no Remote interface is an incomplete 2.1 view.
Benefits here:
* We don't have to guess/infer what the intent of the bean provider was to expose
* We give clear failures on deployment as to why an EJB with partially-implemented 2.1 views to the bean provider.
Invite those with more experience w/ Spec interpretation to invalidate this argument.
S,
ALR
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4092280#4092280
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4092280
18 years, 6 months
[Design of EJB 3.0] - Re: When is there an EJBObject?
by wolfc
In the failing unit test a proxy to a bean with a remote business interface is cast to an EJBObject.
So we can agree that this is in fact an illegal construct?
We can still allow a home-less bean with a remote interface. It would result in a partially realized EJB 2.1 view, only usable by EJB 3 users. (EJBTHREE-1058)
I say for fully realized EJB 2.1 view you must have:
- a home interface (extending EJBHome or EJBLocalHome)
- a remote/local interface (extending EJBObject or EJBLocalObject)
A home interface without a remote/local interface would then be considered an illegal construct and should throw an exception at deployment time.
Same goes for returning some else that the defined remote/local interface from the home's create method(s).
In theory we could infer the remote/local interface from the home interface create method's return type. So an explicit remote/local interface definition is then optional.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4092269#4092269
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4092269
18 years, 6 months
[Design of Clustering on JBoss (Clusters/JBoss)] - Re: Transaction Sticky LB policy for 4.2/trunk
by galder.zamarreno@jboss.com
After finishing implementing jbas-4455 for JRMP, I have just started with unified invokers and I have realised that UnifiedInvokerProxy/UnifiedInvokerProxyHA maintain a
instance reference to the InvokerLocator/Client instances to a specific invocation is using. That is, when a new target is chosen, the unified proxy
updates its Client and corresponding InvokerLocator instances (if they've changed), and uses the Cient instance variable to make the call. As far
as I can see there's no synchronisation in the usage/assignment of Client or InvokerLocator. Proxies are meant to be thread safe which means that
multiple client app threads could be using the same proxy without any problems. I can see all this going wrong the moment someone uses client
proxies this way in a clustered environment with round robin load balance policy. We've got no guarantee that round robin will work correctly in these situations.
JRMP based invokers never had this problem because they never stored the target server invoker used as instance variable. Why should Unified
invoker proxies do so? IMO, it shouldn't. In a clustered environment, such instance variable could be constantly changing, i.e. round robin.
Secondly, looking at FirstAvailable, electedTarget access/update is not synchronised, however, the chances of having some issues are very small. First, the proxy needs to be shared by various threads before the electedTarget has been set, but as electedTarget already elected randomly, the secondary effects of this lack of safety are none.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4092261#4092261
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4092261
18 years, 6 months