0

I have a very basic JTA question.

We are using Spring's AOP to apply WebLogicJtaTransactionManager pointcuts on any method in a service class...and we set the tx:method timeout="60".

What is interesting is within that service, we run a select statement to retrieve records from the database (using Hibernate/JPA) and then go do some work that is not database/transactional related. That method takes longer than 60 seconds to run and a timeout exception is never thrown and the transaction is never rolled back. We don't update or create new objects to persist.

To add to that, we have JTA configured to timeout after 180 seconds on WebLogic Server...and the application still doesn't timeout.

The WLS docs say "The transaction timeout in seconds. If the transaction is still in the "active" state after this time (counting from begin()), it is automatically rolled back. Once the transaction moves on to the prepared state, however, this timeout parameter does not apply; the transaction is retried until all the resources are committed."

Would this behavior be related to the fact that there is nothing for the JTA to commit and therefore the timeout doesn't necessarily apply?

Or does it related to the fact that because there is no real database (insert/update/deletes) so the transaction is never in a true active state?

Jay Blanton
  • 574
  • 2
  • 10
  • 26

1 Answers1

0

The JTA transaction timeout would only apply to XA based datasources. Can you confirm that that the datasource is setup with an XA database driver ?

souser
  • 5,868
  • 5
  • 35
  • 50
  • Thanks for the response. Verified the datasource is an XA database driver. Through some quick testing, looks like it maybe more related to the JMS send message that we do within that JTA call. If we change the session to not be Transacted, we see the JTA timeout now. Before we were setting the session to be Transacted=true...and so that creates a local JMS Transaction which must not be communicating a timeout if it takes too long (because when the JMS Session is transacted...we don't see the JTA timeout/rollback). – Jay Blanton Jun 18 '12 at 19:03