-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Database Transaction Management in Hibernate
PostPosted: Tue Jun 21, 2005 6:47 am 
Newbie

Joined: Tue Jun 21, 2005 6:11 am
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Hi,

We've a big problem in our project. I will try to explain it:
1- We have three pages: 1.jsp, 2.jsp, 3.jsp
2- In each of these jsp files some data are gathered from user and inserts/updates some data in database.
3- The problem is we want to apply all db changes of these jsp file when receiving request of 3.jsp (last one).
4- For example: 1.jsp inserts some data to table CUSTOMER, 2.jsp updates some data in SERVICES table and 3.jsp delete some rows from CUSTSRV table.
we want to do as below:
when receiving request of 1.jsp, start a database transaction, insert data (that entered by user) in CUSTOMER table, but not commit it and display 2.jsp
when receiving request of 2.jsp, update some rows in SERVICES table, but not commit it and display 3.jsp.
when receiving request of 3.jsp, delete some rows from CUSTSRV table and commit transaction to save all data in db.
if we can not delete specified rows from CUSTSRV, transaction must rollbacked and inserted and updated rows in previous steps must be ignored.
Note: All insert/update/delete are done in servlets using hibernate.

I would appreciate if anyone could guide me in this area.

Thanks in advance,
Arash.

_________________
Arash Asadzadeh
PDPSoft Co.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.