use of com.palantir.exception.PalantirSqlException in project atlasdb by palantir.
the class BasicSQL method wrapPreparedStatement.
private <T> T wrapPreparedStatement(final Connection c, final FinalSQLString query, final Object[] vs, PreparedStatementVisitor<T> visitor, String description, AutoClose autoClose) throws PalantirSqlException, PalantirInterruptedException {
SqlTimer.Handle timerKey = getSqlTimer().start(description, query.getKey(), query.getQuery());
PreparedStatement ps = null;
try {
ps = BasicSQLUtils.runUninterruptably(() -> createPreparedStatement(c, query.getQuery(), vs), "SQL createPreparedStatement", c);
return visitor.visit(ps);
} catch (PalantirSqlException sqle) {
throw wrapSQLExceptionWithVerboseLogging(sqle, query.getQuery(), vs);
} finally {
closeSilently(ps, autoClose);
timerKey.stop();
}
}
Aggregations