Hi group,

I've just joined the group because I have been
researching a question for the last few days and
haven't come up with a satisfactory answer.

I want to write a statefull session bean for a client
that will provide exclusive access to a set of table
rows for the client to update.  I've planned on doing
UserTransaction.begin(), using "select...for update"
sql statement to lock the rows, and then either
UserTransaction.commit() or UserTransaction.rollback()
depending on what button's the client clicks on.

Sounds real simple but has two very big problems I've
not found satisfactory answers to.

(1)
I assumed that a UserTransaction, once started, worked
like an HTTP session...meaning that although the HTTP
session has a timeout period, so long as you keep
using the connection, the session does not timeout.
This is not the case for UserTransactions.  It
timesout regardless of how much the statefull session
bean is called.  I call this "to the races" for the
client because they'll have to finish within a certain
amount of time or they'll have to start all over
again.  So, does anyone know if a UserTransaction's
timeout time can be "refreshed" when the statefull
bean is called again?

(2)
catastrophic failure...If the client's machine crashes
or some other irregular use of the client application
occures, the rows in the database will still be locked
by the "select...for update" statement and since a
UT.commit() or UT.rollback() hasn't occured they'll
never be unlocked.  In addition, a bean involved in a
transaction can not be passivated, and, for bean
managed transactions, there are no "call back" methods
(interface) that can be used to take some kind of
action when a transaction timesout.  So far, the best
idea I've come up with is to start a new thread that
actively checks the state of the transaction and rolls
it back if a timeout occures.  This, I believe, is a
real bad way of doing it plus there's the problem I
discussed in (1) about a Transaction timingout even
though the client is still using the stateful session
bean.  Anyone have any thoughts about this one?

BTW, I'm using JBoss-2.4.3 with Oracle 9i

Thanks,
Mike


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

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