For Programmers: Free Programming Magazines  


Home > Archive > Java Beans > October 2004 > Client timeouts, EJBs, and transactions









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Client timeouts, EJBs, and transactions
Frank LaRosa

2004-10-28, 3:59 pm

Hi,

My question is not about a particular app server but about EJB
behavior in general, although the thing I'm getting at is probably
product specific. I'm asking it more for research questions than to
solve a particular problem so any experience you have with any
appserver would be appreciated.

Suppose there is an EJB with a transactional method that takes a very
long time to run. Suppose I call that method from a remote client, and
while it's running, my client either disconnects (say, the user got
tired of waiting and killed it) or the client decides to give up
waiting for the response from the EJB server and throw an exception (I
would imagine such behavior would be vendor-specific, but probably
exists with some products).

My concern is what happens to the transaction that is in progress on
the abandoned EJB call. When the call finally completes, will the
transaction automatically roll back, or will it commit? Is the
behavior vendor-specific or defined by the specification?

I'd like to think that a rollback would be the right behavior, but I
can't find that documented anywhere -- and it also brings up the
question of how the EJB server can know for sure that the client is
still around (imagine a situation where the client disconnects after
the transaction completes but before the results are marshalled back
to it).

If I were a J2EE vendor I might want to wait for the client to
acknowledge receipt of the response before I committed the
transaction; does anyone know if any products actually do this, or
know for sure that a certain product does not?

Thanks for your help.

Frank
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com