Hi,
Oleg Nitz wrote:
> Currently the transaction timeout is set to the default value of
> 1 minute and I cannot find any means to change it, neither globally,
> nor per bean.
You can use setTransactionTimeout(int seconds) on your
TransactionManager instance.
This used to have a bug that I fixed in CVS yesterday.
> Is this task is someone's todo list?
Not really, it is done.
I think that the value set is even used by the
UserTransaction instances.
But please note: The new timeout value is only
used for transaction started _after_ you set
a new timeout.
> Let's increase the default value for now: some of our transactions on
> some of our computers long for 10 or even 30 minutes.
Please be aware that that locking may keep other
users from accessing the same data for as long as
the transaction is active.
I think that the current one minute timeout is a
sensible value.
Long-lived transaction like the 10-30 minute
transactions you are talking about are problematic
due to the locking needed to provide isolation.
If locking is pessimistic as in jBoss you risk
blocking other users for a long time, and if
locking is optimistic the risk of tx rollback due
to isolation violation is high.
I would recommend you try very hard to avoid such
long transactions.
Some litterature talk about "business transactions"
(as opposed to "ACID transactions") to handle
transactions that run for a long (or even indefinite)
time. For long business transactions I have
successfully used manual locking so I only had to do
short ACID transactions at the start and end of the
business transaction. But this is a bit tricky as you
would have to manually take case of atomicy,
concurrency and isolation too. To avoid manual locks
hanging in case of a client crash, I guess you could
use a stateful session bean for the locking.
Best Regards,
Ole Husgaard.