Revision 46308 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.db/org.gvsig.fmap.dal.db.jdbc/src/main/java/org/gvsig/fmap/dal/store/jdbc2/spi/operations/AbstractConnectionOperation.java

View differences:

AbstractConnectionOperation.java
27 27
import java.sql.SQLException;
28 28
import org.gvsig.fmap.dal.resource.exception.AccessResourceException;
29 29
import org.gvsig.fmap.dal.store.jdbc.exception.JDBCTransactionRollbackException;
30
import org.gvsig.fmap.dal.store.jdbc.exception.SQLRuntimeException;
30 31
import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper;
31 32
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSQLBuilderBase;
32 33
import org.slf4j.Logger;
......
122 123
                    try {
123 124
                        LOGGER.trace("Excuting operation {}.", this.getClass().getSimpleName());
124 125
                        result = perform(this.getConnection());
126
                    } catch (SQLRuntimeException ex) {
127
                        try {
128
                            this.getConnection().rollback();
129
                        } catch (Exception e1) {
130
                            throw new JDBCTransactionRollbackException(e1, ex);
131
                        }
132
                        throw new SQLRuntimeException("Can't perform operation '"+this.getClass().getSimpleName()+"'.",ex);
125 133
                    } catch (Exception ex) {
126 134
                        try {
127 135
                            this.getConnection().rollback();
......
139 147
            try {
140 148
                LOGGER.trace("Excuting operation {}.", this.getClass().getSimpleName());
141 149
                result = perform(this.getConnection());
150
            } catch (SQLRuntimeException ex) {
151
                throw new SQLRuntimeException("Can't perform operation '"+this.getClass().getSimpleName()+"'.",ex);
142 152
            } catch (Exception ex) {
143 153
                throw new RuntimeException("Can't perform operation '"+this.getClass().getSimpleName()+"'.",ex);
144 154
            } finally {

Also available in: Unified diff