Assuming the façade is SLSB and it calls MyEntity.
public SLSB implements SessionBean { SessionContext sessionCtx; InitialContext ic; //wouldn't recommend static, but... *static* MyEntityHome mHome; public void setSessionContext(SessionContext ctx) throws EJBException, java.rmi.RemoteException, javax.naming.NamingException { sessionCtx = ctx; ic = new InitialContext(); if (mHome==null) { mHome = javax.rmi.PortableRemoteObject.narrow( ic.lookup("java:comp/env/..."), MyEntity.class ); } } //business methods public void m1() { try { MyEntity m = mHome.findByPrimaryKey(...); } catch (NetworkPartitionException npe) { mHome = null; sessionCtx.setRollbackOnly(); } } } You _may_ want to do mHome static to improve speed, however, that will probably yield to a lot of code running on tons of if and try blocks. Not doing it statically would improve performance as well, as you'd be benefiting from the poolability(yuck) of EJBs. Juan Pablo Lorandi Chief Software Architect Code Foundry Ltd. [EMAIL PROTECTED] Barberstown, Straffan, Co. Kildare, Ireland. Tel: +353-1-6012050 Fax: +353-1-6012051 Mobile: +353-86-2157900 www.codefoundry.com > -----Original Message----- > From: A mailing list for Enterprise JavaBeans development > [mailto:[EMAIL PROTECTED]] On Behalf Of Marco Mistroni > Sent: Tuesday, June 18, 2002 1:32 PM > To: [EMAIL PROTECTED] > Subject: EJB to EJB communication > > > hi all, > i have one question 4 you guys. > i have written an EJB for accessing SAP R/3 for my > application. Now my application needs to be integrated into a > second (remote) application that store data into SAP. > > The second appplication (& its coders) don't know much about > how to call SAP etc, so i want to minimize what they need to > know. Solution that i come out was that i write another EJB > that hides completely the SAP call to the second application, > and it does so by calling the already created EJB; this way, > to the second application the whole process will look like > calling an EJB without knowing exactly all the details > involved in calling SAP R/3. > > THere is only one issue in my design: the newly created EJB > (stateless session) has to lookup, for each method call, the > home directory of the existing EJB. This is going to be very > expensive, since they are running on different machines. > > I am still using EJB1.1, and the alternative would be to use > a Stateful session bean.... > > can anyone suggest me how to proceed?? > > thanx in advance and regars > marco > > ========================= > To unsubscribe, send email to [EMAIL PROTECTED] and > include in the body of the message "signoff EJB-INTEREST". > For general help, send email to [EMAIL PROTECTED] and > include in the body of the message "help". > ==========================================================================To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".