• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC with Oracle Rollback Stratergy

 
Rithanya Laxmi
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have multiple schema from where I am reading the records and writing the records in batches. I am using JDBC with Oracle 11g , please let me know how we can have a rollback if something goes wrong with any of the database transaction? Whether JDBC does have a support for the rollback or whether we use to use Oracle Savepoint to mark the transaction and indicate which part of the transaction needs to be rollbacked? Pleas clarify. Any links on this highly appreciated.

Thanks.
 
A.J. Côté
Ranch Hand
Posts: 417
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can begin a transaction from jdbc and it will be propagated to an oracle transaction then just roll it back if something goes wrong.

Typically:
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3165
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to first disbale the auto commit on your connection object:


And then as A.J mentioned:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic