I'm working on an EJB application that needs to instantiate a fairly large
Java library (which does a bunch of complex and somewhat expensive
operations on startup).
I really only want to start up one copy of the library, or at most a few
copies .. certainly not one per client. So I have tried making the client
access a stateless session bean, and have that bean lookup and
load a stateful session bean, that in turn loads the library.
My reading of the EJB spec suggests that a stateless session bean
can be reused to service multiple clients .. i.e., while only one client
at a time is accessing it, it doesn't necessarily go through a remove/
create cycle when the next client comes in. When the client does
a remove(), the server can choose to keep the bean instance around
for the next client, and not call its ejbRemove() method.
If this were the actual behavior, then it seems that I would get the
desired result. However, the J2EE reference server does not seem
to recycle the stateless session bean in this way, nor does a
commercial server I have tried (name withheld).
Can I rely on this behavior? If not, would funnelling my library
access through a custom resource manager (with some kind
of pooled access to the external Java library) solve this problem?
--Jon
-------------------------------------------------------------------
Jon Dart [EMAIL PROTECTED]
TIBCO Software Inc. 650-846-5099
===========================================================================
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".