Title: problem: InitialContext from two separate appservers

Hi all,
Perhaps someone will know the answer to this.

I am attempting to consecutively access EJBs from two contexts (from two separate Orion app servers).

When I execute the following code (using the Orion J2EE libraries):

----------------
// env1 = context details of app server 1.
// env2 = context details of app server 2.

Context context1                = new InitialContext(env1);
MyEJBHome myEJBHome1    = (myEJBHome)context1.lookup("myEJB");
MyEJB myEJB1            = myEJBHome1.findByPrimaryKey(1);

Context context2                = new InitialContext(env2);
MyEJBHome myEJBHome2    = (myEJBHome)context2.lookup("myEJB");
MyEJB myEJB2            = myEJBHome2.findByPrimaryKey(1);
----------------

I would expect that myEJB1 would be retrieved from app server 1, and my EJB2 from app server 2.  However, I've noticed that myEJB1 and myEJB2 are always both retrieved from the same application server (as specified by the first context - context1).

Is this expected behaviour ?  If so, how am I able to access two distinct application servers with subsequent calls to 'new IntialContext()' ?

Any comments would be apreciated.

cheers,
Alice

Reply via email to