> From the Session Bean B's code, I have already do 'import session A's
> package name', then I have something like
>           SessionA sesA = new SessionA();
>           String returnValue = sesA.somemethod(String someparameter);

You should always get a reference to another EJB via its home interface
so that the instances can be pooled.

Eg:

InitialContext context = new InitialContext();
SessionAHome home = (SessionAHome) PortableRemoteObject.narrow(
context.lookup("java:/comp/env/ejb/SessionA"), SessionAHome.class);
                
SesssionA sesA = home.create();
String returnValue = sesA.somemethod(String someparameter);
sesA.remove();

all this is saying is get me an instance of SessionA from the pool, do
something with it, return it to the pool.

> So why do I still need to establish the ejb-ref for Session bean B
> referencing Session bean A, in ejb-jar.xml ? I find this rather
redundant.

The ejb server needs to know how to find the SessionA home when a
SessionB object references it via a local name (eg: ejb/SessionA).
 
k.


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

Reply via email to