Skip to content

Commit

Permalink
Doc fixes and some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
radovanradic committed Nov 27, 2024
1 parent aa356d9 commit a751cc6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
public interface ConnectionCustomizer extends Named, Ordered {

/**
* Called before JDBC call is issues for given connection.
* Called before JDBC call is issued for given connection.
*
* This method allows implementations to perform additional setup or configuration on the connection.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,11 @@ private <T, R> List<R> findAll(SqlStoredQuery<T, R> sqlStoredQuery, ResultSet rs

@Override
public <T> boolean exists(@NonNull PreparedQuery<T, Boolean> pq) {
SqlPreparedQuery<T, Boolean> sqlPreparedQuery = getSqlPreparedQuery(pq);
return executeRead(getMethodInfo(sqlPreparedQuery), connection -> {
SqlPreparedQuery<T, Boolean> preparedQuery = getSqlPreparedQuery(pq);
return executeRead(getMethodInfo(preparedQuery), connection -> {
try {
try (PreparedStatement ps = prepareStatement(connection::prepareStatement, sqlPreparedQuery, false, true)) {
sqlPreparedQuery.bindParameters(new JdbcParameterBinder(connection, ps, sqlPreparedQuery));
try (PreparedStatement ps = prepareStatement(connection::prepareStatement, preparedQuery, false, true)) {
preparedQuery.bindParameters(new JdbcParameterBinder(connection, ps, preparedQuery));
try (ResultSet rs = ps.executeQuery()) {
return rs.next();
}
Expand Down Expand Up @@ -805,7 +805,7 @@ public <T> Iterable<T> persistAll(@NonNull InsertBatchOperation<T> operation) {
});
}

private <I> I executeRead(MethodInfo methodInfo, Function<Connection, I> fn) {
private <I> I executeRead(@Nullable MethodInfo methodInfo, Function<Connection, I> fn) {
if (!jdbcConfiguration.isAllowConnectionPerOperation() && connectionOperations.findConnectionStatus().isEmpty()) {
throw connectionNotFoundAndNewNotAllowed();
}
Expand Down Expand Up @@ -841,7 +841,7 @@ private void beforeCall(@NonNull Connection connection, @Nullable MethodInfo met
try {
connectionCustomizer.beforeCall(connection, methodInfo);
} catch (Exception e) {
LOG.debug("An error occurred when calling listener {} beforeCall.", connectionCustomizer.getName(), e);
LOG.debug("An error occurred when calling connection customizer {} beforeCall.", connectionCustomizer.getName(), e);
}
}
}
Expand All @@ -854,7 +854,7 @@ private void afterCall(@NonNull Connection connection, @Nullable MethodInfo meth
try {
connectionCustomizer.afterCall(connection);
} catch (Exception e) {
LOG.debug("An error occurred when calling listener {} afterCall.", connectionCustomizer.getName(), e);
LOG.debug("An error occurred when calling connection customizer {} afterCall.", connectionCustomizer.getName(), e);
}
}
}
Expand Down

0 comments on commit a751cc6

Please sign in to comment.