2 Replies Latest reply on May 2, 2006 4:24 AM by Peter Kaas

    Long transaction and transaction timeout

    Leos Urban Newbie

      I have the following stateless session bean:

      public class UtilityBean implements UtilityRemote
       EntityManager manager;
       private void deleteStockItems()
       System.out.println("Start deleting StockItems");
       Query qStockItem = manager.createQuery("delete from StockItem");
       int retValue = qStockItem.executeUpdate();
       System.out.println("Deleted "+retValue+" rows.");
       System.out.println("End deleting StockItems");
       .., here are similar methods for other entities ...
       public void deleteAllData()
       System.out.println("Start deleting all data in database");
       System.out.println("End deleting all data in database");
       public void free()

      When I invoke deleteAllData() method from client, I get after 5 minutes warning (only part):
      WARN [org.jboss.tm.TransactionImpl] Transaction timed out. status=STATUS_ACTIVE

      And when method ends then I obtain exception (only part):
      ERROR [org.hibernate.util.JDBCExceptionReporter] Transaction is not active

      Solution - change in jboss-service.xml file section of "TransactionManagerService" the value of "TransactionTimeout" from 300 to 1200.
      It means prolong timeout from 5 minutes to 20 minutes.

      Is this correct way? Does exist other solution (for example manually set timeout per sessionbean / method) ?

      Thank you very much,