I don't think my words should be seen as advice.. just $0.02
I would not worry about the unhappy path too much, I assume that all updates that you make are in a transaction, and if this transaction is rolled back the updates are not made, hence no need to update db. Also I don't recall a requirement to send an email if the transaction fails, only for confirmation ( I would see it as some kind of email receipt )
Hmm, but you're right the timing is tight. Even the best airline sites struggle to give a 5 sec response for transactions.
I wonder if it is possible to give the interaction with the transaction processors to another thread, update the DB, send email etc in the mail thread and then join the transaction thread and wait for confirmation. If positive, just return otherwise rollback?
But I need to give this much more thought.. Is it possible or correct to spawn threads from within an EJB? - would having 600+ concurrent threads be workable? I suspect not, but there may be another way.
There is an issue here, I dont have an answer yet.
[ April 09, 2006: Message edited by: Richard Bourner ]