This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi, This question was asked in an interview. I guess lot of people here must be knowing the solution. In an ecommerce application using jsp/servlet etc , when we make a connection to payment server(ex:verisign) for creditcard processing, we get the transaction results from the payment server and they need to be put in the database. But, if we make a request and the internet connection is down by the time the payment server sends the results, how do we get the results and store them in db? Any takers please... thanks in adv, RS.
You should rollback such transactions.Also server should have the capacity to cancel the request after sometime if it can't send the results back. But I would like to here from other folks what they think.
You could look into using JMS (see Java Message Service API) as a mechanism for guaranteeing that the requests are processed. The idea is that you put a request on a JMS queue (the request might include JDBC transactions, etc) and even if the database was down, the request would be queued and then processed when the database became available. I believe that JMS can be used outside of a J2EE container. There are several commercial implementations of JMS, as well as some that you can try [use?] for free.