Hi 
I have a SessionBean which is dealing with a remote http-webservice. Sometime 
the webservie is down and I need to get a timeout within a reasonable time. 
Therefore I implemented in my SessionBean business method a own transaction 
handling via UserTransaction and the TransactionTimeout functionality. 
Unfortunately when the time out is reached the method throws no exception, it 
still tying to connect to the webservice.

 
  | public Hashtable getArchiveItemList(String mandantId, Hashtable params, int 
responseSizeLimit) throws Exception {      
  |         UserTransaction transaction = ejbContext.getUserTransaction();
  |         
  |         try{ 
  |             transaction.setTransactionTimeout(10);
  |             transaction.begin();
  |             
  |             // --> Web service connection code...
  |             // not showed...
  |             
  |              transaction.commit();
  |         }
  |         catch(Exception e){
  |             transaction.rollback();
  |             NovoPortalLog.error(this,"getDocumentList()",e);
  |             throw new Exception(e.getMessage());
  |         }
  | }
  | 

The 10 Sec. timeout works, I get the following WARN in the server.log
 
  | 15:15:39,702 WARN  [TransactionImpl] Transaction 
TransactionImpl:XidImpl[FormatId=257, GlobalId=meilen/8, BranchQual=, 
localId=8] timed out. status=STATUS_ACTIVE
  | 

About 4 minutes later I get than a exception from the Webservice.

Q1) Should not a Exception be thrown when the UserTransaction timeout is reach?

Q2) Is there any alternative to handle a transaction timeout?

Many thanks!


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3860010#3860010

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3860010


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to