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

rollback database on button click

 
pourush rohila
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everyone

how we create a swing application with 2 buttons named delete and rollback, when click on delete button data should be deleted from database and when we click on rollback button then it rollback deleted data
 
K. Tsang
Bartender
Posts: 3583
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you are doing a undo command.

From DB perspective, once the transaction is committed, technically it can't be rolled back. A new insert is needed.

However if you control the commit level, when you click the delete button BUT don't commit, then technically you CAN roll back by click the "rollback" button. But then when will you commit to make the delete permanent? Because if you say refresh your data, those deleted data may still be there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic