Hi, I had set the save point in my code after 2 insert statment , when i will rollback the transaction then it will roll back up to save point , now i need to roll back all the trancastion , i mean i need to rollback the transaction from begining , (before the savepoint) can i do this
code insert update savepoint save1
then it will rollback the transaction upto savepoint
There are two overloaded versions of Connection.rollback(). The one that takes a Savepoint argument should rollback the transaction to the specified Savepoint; the other one should rollback the whole transaction, i.e. to the last commit point. You need to ensure you have setAutoCommit(false).
If that doesn't work for some reason you could try calling releaseSavePoint() before your rollback.