Search code examples
oracleplsqlsavepoints

ORA-01086: savepoint 'L_SAVEPOINT' never established in this session or is invalid


In my case, savepoint was set in Java and I am trying to rollback in a plsql procedure which was called in Java using a callable statement.

There are no commits or rollbacks in between, but I am still seeing the error:

ORA-01086: savepoint 'L_SAVEPOINT' never established in this session or is invalid

Is it because the savepoint is set in Java and I am trying to rollback in plsql? Can someone please help me with this?


Solution

  • Java and plsql procedure are considered as 2 different transactions. Issue got fixed for me when I set the savepoint inside the PL/SQL procedure and rollback also inside the procedure.