Thanks for the response C Chavan, this is an interesting idea.
A few thoughts / issues I have:
1. You mention calling the CC validator via JMS, is this different than using a MDB? I assume they are identical since MDB piggybacks on JMS. I ask because in the
EJB 2.0 spec it says that messages are not delivered until you commit your transaction. I am currently using CMT, which will not work for what you describe (at least not in a single bean).
2. How would I poll the DB row waiting until it changes to "completed"? I assume I read it, if it is in state "waiting", I do a Thread.sleep(), right? Is this use of threads violating the EJB spec? If I remember correctly, it says you can't create threads, but maybe I can use static methods on them. :roll:
Assuming I wanted to keep CMT, I guess I would end up looking something like this:
Is this what you were expecting? I could also acheive this result from the action class with 2 remote calls, like this:
I'm not sure if I will do it this way, but it is definetly food for thought. I would rather spawn a thread to call the web service and join it before my Session Bean completes - as described in my response to Kyle. But this mediator is a neat idea....
Any thoughts?
Thanks!
--Dave.
[ March 20, 2004: Message edited by: Dave Teare ]