Page 1 of 1
About Question enthuware.ocpjp.v7.2.1195 :
Posted: Sun Aug 02, 2015 11:35 am
by Danny Sheridan
Explanation:
connection.rollback(savepoint) ensures that any statements executed after that save point was created will not be commited.
Any statements executed before that will be committed.
But surely not without c.commit() or c.setAutoCommit(true) being called?
In other words, couldn't the transaction possibly have further queries and rollbacks which might result in these earlier statements not being commited?
Re: About Question enthuware.ocpjp.v7.2.1195 :
Posted: Sun Aug 02, 2015 8:01 pm
by admin
Yes, of course, you need to call commit to commit the changes and yes, it is also possible to rollback all of the changes made after the previous commit.
The explanation is only talking about the effect of rollback(savepoint) method. The whole purpose of setting a savepoint is to be able to roll back only some of the changes that you have made. Calling this method rolls back the changes made after the savepoint. All others will be committed as and when you call commit. Calling the rollback method doesn't commit the changes.
The explanation is updated to make this clear.
thank you for your feedback!
Paul.