Why would you want to reuse a statefull session bean?

You may have a different state that you want to use. We had a similar
problem as we had to reuse a bean though with a different state. We then
decided to have a class which had all the implementation of the bean class
and the bean only called the corresponding method in the implementation
class.

So now from a different bean (in the same jar) I did not have to instantiate
the state full bean but called the methods in the implementation class.

Anish



 -----Original Message-----
From:   Alex Paransky [mailto:[EMAIL PROTECTED]]
Sent:   Monday, November 26, 2001 5:37 PM
To:     [EMAIL PROTECTED]
Subject:        Problem with deleting Stateful Session beans during a
transaction...

We are using a builder pattern to create some of the objects.  In a
transaction we create the Builder (Statefull Session Bean) and then execute
methods on it in order to setup certain properties.  At the end of the
transaction, we call the build(...) API which constructs the object
according to the specifications.  At the end of the transaction, we attempt
to remove(...) the builder, since it's no longer needed, however, we get an
exception stating that Statefull Session beans cannot be removed during
transaction.

If Statefull Session beans cannot be removed during a transaction, what are
they good for?  Since I am not sure how the deplorer will wrap transactions
around my beans, I am not really able to use Statefull Session beans in ANY
of my EJB development.

Is there a way around this?  Perhaps the bean can be submitted to some
garbage collector that would wait for the transaction to be over before
removing the bean?

Has any one worked around this nasty problem?


Thanks.
-AP_

===========================================================================
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".

Reply via email to