Hi
I have a Session bean (transaction managed by Container, Requries new) that uses JMS/MQ to get certain information from an IMS enviornment in a *synchronous* manner.So the bean writes certain queries to IMS on a queue and waits on reply queue.
Sometimes it so happens that IMS does not respond quickly - for whatever reasons. In such cases the transaction times out and container(websphere) rollsback entire transaction. Is there a way to do something like this:
Send message for IMS
see if it had taken more than 30 seconds - if so, throw an application exception? with in the boundaries of J2ee specification?
Thanks in advance
Discussions
EJB programming & troubleshooting: How to handle transaction time out before timing out?
-
How to handle transaction time out before timing out? (3 messages)
- Posted by: ranji c
- Posted on: November 10 2005 18:53 EST
Threaded Messages (3)
- How to handle transaction time out before timing out? by Billy Newport on November 11 2005 10:06 EST
- How to handle transaction time out before timing out? by Billy Newport on November 11 2005 10:07 EST
- How to handle transaction time out before timing out? by ranji c on November 14 2005 11:57 EST
-
How to handle transaction time out before timing out?[ Go to top ]
- Posted by: Billy Newport
- Posted on: November 11 2005 10:06 EST
- in response to ranji c
Specify a timeout on the blocking receive call. Example
Message m = QueueReceiver.receive(30000);
if(m == null) // we timed out and rollback the tran -
How to handle transaction time out before timing out?[ Go to top ]
- Posted by: Billy Newport
- Posted on: November 11 2005 10:07 EST
- in response to ranji c
Also be sure to have committed the tx where you send the original message, otherwise, it'll never get there :) You need two transactions, one to send and a new one to receive.
Billy -
How to handle transaction time out before timing out?[ Go to top ]
- Posted by: ranji c
- Posted on: November 14 2005 11:57 EST
- in response to ranji c
Thanks a lot!