Announcement Announcement Module
Collapse
No announcement yet.
Transaction Timeout (WebSphere, DataSource DB2) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Transaction Timeout (WebSphere, DataSource DB2)

    Hi,
    I work with WSAD5.1.2/WebSphere5.1 test environment.
    Using the JtaTransactionManager to write in a DB2 v8.1.3 datasource (the ds is ok, i can read/write without any problem), if i code a manual transaction via TransactionTemplate:

    Code:
     TransactionTemplate tt = new TransactionTemplate( ptm);
     tt.execute( new TransactionCallbackWithoutResult() {
        protected void doInTransactionWithoutResult( TransactionStatusts){
           daoCity.updateCity( aCity);
        }
     });
    The tt.execute runs ok, no exception, but I get a TransactionTimeout after 120 Sec.
    Is something missing in my code to close the transaction ???
    Thank you for help !

  • #2
    The whole point of the TransactionTemplate is that it manages the lifecycle of the transaction, so you don't have to do anything to commit.

    But if you are using JTATransactionManager, keep in mind that you will basically be participating in any existing JTA transactions, so if there are any ongoing, the end of the template will not force a real commit of the real transaction.

    Also, as per the JTATransactionManager JavaDocs, you might try setting the transactionManager property to use WebSphereTransactionManagerFactoryBean, so Spring can find and use the JTA TransactionManager object in the environment, not just the UserTransaction object, although this shouldn't make a difference...

    Comment

    Working...
    X