Skip to content

Commit f517e85

Browse files
committed
Fixed inconsistent backport of #811
Added general debug logging for statement completion failure
1 parent 4e7e2e3 commit f517e85

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/main/org/firebirdsql/jdbc/FBPreparedStatement.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import org.firebirdsql.jdbc.field.FBFlushableField;
3333
import org.firebirdsql.jdbc.field.FBFlushableField.CachedObject;
3434
import org.firebirdsql.jdbc.field.FieldDataProvider;
35-
import org.firebirdsql.logging.LoggerFactory;
3635

3736
import java.io.InputStream;
3837
import java.io.Reader;
@@ -147,14 +146,7 @@ protected FBPreparedStatement(GDSHelper c, String sql, int rsType,
147146
try {
148147
prepareFixedStatement(sql);
149148
} catch (Exception e) {
150-
try {
151-
notifyStatementCompleted(false);
152-
} catch (SQLException e2) {
153-
LoggerFactory.getLogger(getClass())
154-
.debug("Failed statement completion triggered by exception during statement prepare", e);
155-
e2.setNextException(e instanceof SQLException ? (SQLException) e : new SQLException(e));
156-
throw e2;
157-
}
149+
notifyStatementCompleted(false, e);
158150
throw e;
159151
}
160152
}

src/main/org/firebirdsql/jdbc/FBStatement.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,12 +306,14 @@ void notifyStatementCompleted(boolean success, Exception originalException) {
306306
try {
307307
notifyStatementCompleted(success);
308308
} catch (SQLException e) {
309+
log.debug("Statement completion failure by exception", e);
309310
if (originalException instanceof SQLException) {
310311
((SQLException) originalException).setNextException(e);
311312
} else {
312313
originalException.addSuppressed(e);
313314
}
314315
} catch (RuntimeException e) {
316+
log.debug("Statement completion failure by exception", e);
315317
originalException.addSuppressed(e);
316318
}
317319
}

0 commit comments

Comments
 (0)