Hello,
I have the following stateless session bean:
| @Stateless
| public class UtilityBean implements UtilityRemote
| {
| @PersistenceContext(unitName="performance_persistence_unit")
| EntityManager manager;
|
| @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
| 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 ...
|
| @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
| public void deleteAllData()
| {
| System.out.println("Start deleting all data in database");
| deleteStockItems();
| deleteOrderItems();
| deleteOrders();
| deleteCompanies();
| deleteCountries();
| System.out.println("End deleting all data in database");
| }
|
| @Remove
| 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,
Leonell
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3940355#3940355
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3940355
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user