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

  • Transaction Timeout (WebSphere, DataSource DB2)

    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:

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