Hey

[EMAIL PROTECTED] wrote:
> 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.
<snip>

Are the MQSeries-connections tied to the state in the session bean, or
are they stateless (i.e. anyone can use it)?

If the latter then you should be able to create the connection in
setSessionContext() and close it in finalize(). Why finalize? Well,
you'd rather have it closed in the equivalent of unsetEntityContext, but
since Session Beans don't have any equivalent of that finalize is as
close as it gets.

/Rickard

--
Rickard �berg

Computer Science student@LiTH
@home: +46 13 177937
Email: [EMAIL PROTECTED]
Homepage: http://www-und.ida.liu.se/~ricob684

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