I have got a question about EJB session stateless & handle.
I get the handle of the EJB (session stateless) on the init method of a
servlet, and in the service method I do the following statements:
private FooEJB foo; // EJB session stateless
private Handle fooHandle; //Handle of the foo EJB
public void init()
{
.....
fooHandle = foo.getHandle();
}
public HttpResponse service (....)
{
try
{
this.foo.doSomething();
}
catch (RemoteException e)
{
// If the there is an exception I try the business mehtod again
try
{
foo = fooHandle.getEJBObject();
this.foo.doSomething();
catch(Exception ex)
{
// trace error
}
}
}
With this statements I try to avoid invoking the create method of the
EJB in each service method call, to increase the performance, so I store
the handle of the EJB and if a RemoteException is thrown i try to get
the EJB again. What do you think about this? is this correct or wrong?,
more solutions ?
Thanks in advance.
===========================================================================
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".