• Post Reply Bookmark Topic Watch Topic
  • New Topic

transaction management question  RSS feed

 
Karan Jain
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to do transaction in oracle with JDK 1.3.
In my transaction i need to execute a set of queries in different modules and need to rollback if any query failed.

One more thing is while i am doing this processing in my servlet, I need to confirm with the user if he really wants to process before i do the database commit.

I am not able to visualize the process in terms of coding. I need to use JSP, Servlet and javascript.

Any help is appreciated.

Thanks and regards,
Karan
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to confirm with the user if he really wants to process before i do the database commit.

This is almost certainly poor design. The reason is that transactions should be as short as possible and should not include user think time. Try and redesign your application so that the transaction starts as late as possible and finishes as soon as possible.
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hold the data in a HttpSession or even in a temp table (not terribly good), present it to the user for confirmation and start your transaction only after the user confirms. If you are using an ejb, use CMT and stateless session beans. In a non-ejb application, you can still use jta for transaction management or even good old jdbc.

Do clean up your session object afterwards.

cheers,
ram.
 
Karan Jain
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Roger and Ram...
I too understand this looks like a weird design... but this is our business requirement... i think i should talk to my business guys to re-consider this requirement of interrupting in midst of processing...

thanks again...
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!