Question - What is savepoint and what are the methods we have in JDBC for savepoint?
Answer -
Savepoint is used to create checkpoints in a transaction, and it allows us to perform a rollback to the specific savepoint. Once the transaction is committed or rolled backed, the savepoint that has been created for a transaction will be automatically destroyed and becomes invalid.
Methods for Savepoint:
- setSavepoint() method: It is used to create Savepoint, we can use the rollback() method to undo all the changes till the savepoint.
- releaseSavepoint() method: It is used to remove the given savepoint.