On Thursday, October 24, 2002, at 05:16 AM, Emerson Cargnin - SICREDI Servi�os wrote:

I have some questions regarding to caching homes and session beans in the remote client :

1- I already cache initicalcontext and homes in businness delegate, is it secure to cache the real session object as a static attribute in business delegate and reuse it across a long time ?
It is quite reasonable to do this, so long as you are prepared for the fact that the session bean may be removed by the container without notice. This happens if the bean is idle for a long time (as specified in the container configuration), or if it ever throws a system exception.



2- If i call the same session object instance simultaneously from two different threads it will serialize the business method calls?
This is not a good idea. From 7.11.8 in the spec:

The container must ensure that only one thread can be executing an instance at any time. If a client
request arrives for an instance while the instance is executing another request, the container may throw
the java.rmi.RemoteException to the second request if the client is a remote client, or the
javax.ejb.EJBException if the client is a local client.[6]

Note that a session object is intended to support only a single client. Therefore, it would be an
application error if two clients attempted to invoke the same session object.

You also need to be aware of the "Restrictions for Transactions" section in 7.6.4.


I made this question because we use a satellite line between web and ejb layers (bank office and central bank site) and it takes 1,5 seconds to the cached home to just create the session facade bean.

if someone has any better approache, i'd appreciate.

Thanks in advance

Steve Coy


-------------------------------------------------------
This sf.net email is sponsored by: Influence the future
of Java(TM) technology. Join the Java Community
Process(SM) (JCP(SM)) program now.
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en

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

Reply via email to