Discussion:
transaction not timing out
(too old to reply)
bnmbn ghjhg
2005-02-02 10:26:44 UTC
Permalink
Hi,

We run the following code from a stateless sessionbean. The code calls a stored procedure containing a never returning loop, the transaction never times out.

uts = ctx.getUserTransaction();
uts.begin();

// call to some function that calls a stored procedure, never returns

uts.commit();

We tried with

uts.setTransactionTimeout(...);

but it doesn't help.

tried

UserTransaction tx = (UserTransaction) ictx.lookup("javax.transaction.UserTransaction");
tx.setTransactionTimeout(10);
tx.begin();

but it didn't help either.

Are there any settings we are supposed to change when working manually with user transactions. Weblogic transactions seem to work fine.

Thanks,

A.
Rob Woollen
2005-02-02 19:50:17 UTC
Permalink
When a transaction times out it does the rollback in a separate thread.
WLS is not usually able to interrupt your user thread.

-- Rob
Post by bnmbn ghjhg
Hi,
We run the following code from a stateless sessionbean. The code calls a stored procedure containing a never returning loop, the transaction never times out.
uts = ctx.getUserTransaction();
uts.begin();
// call to some function that calls a stored procedure, never returns
uts.commit();
We tried with
uts.setTransactionTimeout(...);
but it doesn't help.
tried
UserTransaction tx = (UserTransaction) ictx.lookup("javax.transaction.UserTransaction");
tx.setTransactionTimeout(10);
tx.begin();
but it didn't help either.
Are there any settings we are supposed to change when working manually with user transactions. Weblogic transactions seem to work fine.
Thanks,
A.
Albert Luo
2005-02-04 21:41:29 UTC
Permalink
Are u using BMT or CMT? If you're using CMT, the setting u're putting in your code won't work. The transaction timeout setting is set at the DD file.

One more thing, make sure that the transaction type in that method is a transaction-enabled type (ie. Reuired, RequiredNew and etc).
bnmbn ghjhg
2005-02-09 08:31:11 UTC
Permalink
As it turned out it seems none of our transactions times out (neither user managed or container managed) when the database takes over. That meaning, if a stored procedure never returns, Weblogic does not rollback the transaction. We have now tested with an XA connection pool but it still doesn't work. Does anyone have any experience of Weblogic rolling back transactions that get stuck in the database? Running jdbc in debug mode shows that Weblogic is aware that the transaction exceeded the configured timeout but seems to be unable to roll it back.

Thanks,

A.

Loading...