Hello François,

thank you for your response. In fact, before I read the Sun Docs, I was quite sure 
that I HAVE TO use stateFUL, because I
wasn't able to see a difference between keeping a Connection to keeping business data. 
So I was quite upset reading that Sun
wants the container to make this possible...

I thought that it is a problem of transaction ending forcing the connection to be 
closed, so I implemented client-demarcated
transactions - the problem remained, even I called remove() before commit() (so there 
seems to be a bug in the transactional
behaviour of stateless session beans). :-(

Well, at the moment I decided to make stateless sessions beans with a short time 
connect at each call. This is terribly slow
(because of the many PREPARES now running agains the DB), but it seems to work stable. 
Do you think that it works well with
stateFUL beans? Ok, so I will try this.

Thank you
Markus


> 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: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]

Reply via email to