This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need to delete record and add record in one method.

 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, with spring mvc 3.0.5 and hibernate 3, I have created a dao/service web service layer for interacting with mysql 5.

When user click the submit button, my application require to delete all related records from a table then add another set data to the table.
I wonder how to achieve that.

The remove() method is written as below:








I am also thinking use begingTransaction and endTransaction around the removeall() and create() function, but I don't know how and not even sure whether that can solve my problem.

Any suggestion would be very appreciated.
Thanks
Sam
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the exception you are getting as well. This saves people a lot of time finding the problem.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic