Discussions

EJB programming & troubleshooting: Transactions and Client Disconnects

  1. Transactions and Client Disconnects (1 messages)

    Hi,

    Suppose a transactional EJB method is running on behalf of a remote client and the client abruptly crashes or disconnects from the network while the transaction is in progress. Will the EJB container recognize that the client is no longer connected and roll back the transaction when the method completes, or will it allow the transaction to commit? Assume the method call itself encountered no problem and threw no exception.

    Thanks,

    Frank
  2. Transactions and Client Disconnects[ Go to top ]

    Frank,

    There is no requirement that the EJB container should check client connectivity while in-flight. So your txn will continue and hit its ultimate fate (commit or rollback) depending on the method execution outcome.

    Hoever, if the transaction spans across two method calls and the client disconnects between the two, the transaction will timeout and rollback.

    -Sanjay