This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maintaining transactions in a jsp application

 
Rajen Seth
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Nag Rao
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Wayne L Johnson
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rajen Seth
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you both for the replies.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic