Hello Markus,
we will have a look at this problem of maintaining
connections in the state of stateless session bean (and
managing correctly their attachement to transactions).
However we are currently recoding part of the session
bean implementation for introducing passivation/activation
of stateful session beans, thus it is preferable to wait.
However you should try this way of coding with
stateful session beans instead of stateless ones, since I
think that this should work.
Best Regards,
François
[EMAIL PROTECTED] wrote:
> In Sun's EJB Developer's guide, I found the following:
>
> > Longterm Connections
> > You can design an enterprise bean that holds a database connection for its entire
>lifetime. Because the bean connects and >
> disconnects just once, its code is slightly easier to write. But there's a
>tradeoff-- other enterprise beans may not >
> acquire the connection. Session and entity beans issue the lifelong connections in
>different methods.
> >
> > Session Beans
> > The EJB container invokes the ejbCreate method at the beginning of a session
>bean's life cycle, and invokes the ejbRemove >
> method at the end. To retain a connection for the lifetime of a session bean, you
>connect to the database in ejbCreate and >
> disconnect in ejbRemove. If the session bean is stateful, you must also connect in
>ejbActivate and disconnect in >
> ejbPassivate. A stateful session bean requires these additional calls because the
>EJB container may passivate the bean >
> during its lifetime. During passivation, a stateful session bean is saved in
>secondary storage, but a database connection >
> may not be saved in this manner. Because a stateless session bean cannot be
>passivated, it does not require the additional >
> calls in ejbActivate and ejbPassivate. For more information on activation and
>passivation, see the section, "The Life Cycle >
> of a Session Bean". For an example of a stateful session bean with a longterm
>connection, see the TellerEJB.java code.
>
> I want to make a stateless session bean that holds it's connections and
>CallableStatements across method invocations (Each
> client calls many of the methods, and each method does only a call to a stored
>procedure. So this should lead to improved
> per-client performance, but poor over-all performance). I tried what is said above
>in my bean. It does not work. JOnAS tells
> me, that after the call, the conn.close() is missing (XASTART without XAEnd and so
>on. "Force a physical close...").
>
> Is there a trick what I have to do to make this run? Or is JOnAS not wanted to run
>such beans? Or is it a bug (any idea where
> I can look to fix it)?
>
> Thank you
> Markus
>
> P.S.: I found similar case in mailing list archive, but could not locate a solution
>there.
--
==================================================================
Francois EXERTIER Evidian (Groupe Bull)
1, rue de Provence, BP 208, 38432 Echirolles cedex, FRANCE
mailto:[EMAIL PROTECTED]
http://www.evidian.com/jonas http://www.objectweb.org/jonas
Tel: +33 (0)4 76 29 71 51 - Fax: +33 (0)4 76 29 77 30
==================================================================
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".