Hi All,
I'm doing some work on a container at the moment
and have a question that I hope someone might be
able to help me with. The issue is with regards
to the life cycle of the EJBObject instance for
entity beans.
With session beans, when a client has finished,
it can do a remove() on the remote object and
the container can remove the EJBObject instance
associated with the session bean instance and
pool the bean. Similarly, if the session times
out then the container could remove the EJBObject
instance and pool the bean instance.
However, for entity beans, the client will not
call remove() on the remote object unless it
wants to remove the data from the database.
Because of that, the container has no easy way
of knowing that the client has finished with
the bean. For a container architecture with a
1-1 relationship between EJBObject instances
and entity bean instances, the number of
EJBObjects instances could just keep growing
and become too big and my question is how can
I decide to delete them?
Initially I thought that maybe I could delete
the EJBObject instance once a client transaction
has finished but there's no way of knowing that
the client isn't going to execute another
transaction a short while later, and I'm not sure
if client communication always has to be within a
transaction. One option might be to let the
EJBObject timeout after a certain period of
inactivity but clients are also able to save an
EJBObject handle for use later on so there would
be problems there - unless the timeout was ignored
by EJBObject instances who'd been getHandle()'ed
by a client. Maybe another option would be to let
them timeout and have an EJBObjectFactory create
instances on the fly as required? Or maybe my
1-1 relationship between EJBObject instances and
entity bean instances should be a changed to a
singleton EJBObject instance delegating to
multiple entity bean instances, although this
seems like it might be a bit of a bottleneck.
Any ideas or comments appreciated.
Cheers,
John.
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
===========================================================================
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".