Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

This code snippet easily bring the database into inconsistent state  RSS feed

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

If saveAuth is okay, but suddenly the power fails, and updateCustomerAuth
can't proceed, the database is in an inconsistent state.
I tried to use foreign key constraint with a cascade update,
and don't know if that works.
Any opinion?
Thanks
Jack
 
E Armitage
Rancher
Posts: 989
9
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
E Armitage wrote:You should use transactions: http://docs.oracle.com/javase/tutorial/jdbc/basics/transactions.html



Thanks, I'll just dig into that.
Jack
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!