I am writing an EJB that uses MQSeries.

The bean is a stateful session bean.

Since MQ series is an external resource and the classes are not serializable
during passivation I close the connections and set the objects to null.
Then, when the bean is activated, I reconnect to MQ Series.

These beans are used over a long period of time during which
activation/passivation occurs many times.

I would like to be able to create the connection once. Use the connection
for an extended period of time. Then close the connection.

In regards to the stateful session bean the EJB spec. says:

"In advanced cases, a session Bean's conversational state may contain open
resources. Examples of this are: open files, open sockets, and open database
cursors. It is not possible for a container to retain open resources while a
session Bean is passivated. A developer of such a session Bean must close
and open the resources using the ejbPassivate and ejbActivate
notifications."

However in regards to the entity bean the spec. says:

"The ejbPassivate() method gives the enterprise Bean the chance to release
any resources that should not be held while the instance is in the pool
(these resources typically had been allocated during the ejbActivate()
method)."


Is there any way that I can avoid reconnecting each time the bean is
passivated/activated?

Do the same rules regarding open resources for session beans apply to entity
beans?


Thanks,

Phillip Schroder
Senior Software Engineer
Carreker-Antinori, Inc

[EMAIL PROTECTED]

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