Don't try to rollback if the failure resulted in the connection being
closed. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1690 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -142,9 +142,10 @@ public class SimpleRepository extends Repository
|
||||
|
||||
} catch (SQLException sqe) {
|
||||
if (attemptedOperation) {
|
||||
// back out our changes if something got hosed
|
||||
// back out our changes if something got hosed (but not if
|
||||
// the hosage was a result of losing our connection)
|
||||
try {
|
||||
if (supportsTransactions) {
|
||||
if (supportsTransactions && !conn.isClosed()) {
|
||||
conn.rollback();
|
||||
}
|
||||
} catch (SQLException rbe) {
|
||||
@@ -181,7 +182,7 @@ public class SimpleRepository extends Repository
|
||||
} catch (PersistenceException pe) {
|
||||
// back out our changes if something got hosed
|
||||
try {
|
||||
if (supportsTransactions) {
|
||||
if (supportsTransactions && !conn.isClosed()) {
|
||||
conn.rollback();
|
||||
}
|
||||
} catch (SQLException rbe) {
|
||||
@@ -193,7 +194,7 @@ public class SimpleRepository extends Repository
|
||||
} catch (RuntimeException rte) {
|
||||
// back out our changes if something got hosed
|
||||
try {
|
||||
if (conn != null && supportsTransactions) {
|
||||
if (conn != null && supportsTransactions && !conn.isClosed()) {
|
||||
conn.rollback();
|
||||
}
|
||||
} catch (SQLException rbe) {
|
||||
|
||||
Reference in New Issue
Block a user