Skip to main content

when connection.commit failed, does connection.rollback be automatically called?

1 reply [Last post]
zhaojianyong
Offline
Joined: 2009-03-21
Points: 0

when connection.commit failed, does connection.rollback be automatically called?
Or I need to call connection.rollback manually to rollback Transaction.

The below description (getted from Java API Specification) is only for successfully commit, or for all cases?
"Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object."

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
P1tbull
Offline
Joined: 2011-05-16
Points: 0

What technologies do you use for make a persistence layer?
Because EJB3 offer automatic rollback. but other does not.