About Question enthuware.ocpjp.v7.2.1195 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
Danny Sheridan
Posts: 30
Joined: Sat May 02, 2015 4:48 pm
Contact:

About Question enthuware.ocpjp.v7.2.1195 :

Post 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?

admin
Site Admin
Posts: 10389
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1195 :

Post 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.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests