@@ -21,8 +21,8 @@ public QueryProcessor(final Connection connection) {
21
21
22
22
public void executeAndProcessQuery (final AbstractResultSetProcessor processor ) {
23
23
final String processorName = processor .getClass ().getName ();
24
- log .info ("Starting query with result set processor {}." , processorName );
25
24
long now = System .currentTimeMillis ();
25
+ log .info ("Starting query with result set processor {}. {}" , processorName , now );
26
26
27
27
ResultSet resultSet = null ;
28
28
try {
@@ -35,7 +35,7 @@ public void executeAndProcessQuery(final AbstractResultSetProcessor processor) {
35
35
} catch (Exception e ) {
36
36
log .error ("Failed to process query" , e );
37
37
} finally {
38
- closeQuery (resultSet );
38
+ closeQuery (resultSet , now );
39
39
}
40
40
41
41
long elapsed = (System .currentTimeMillis () - now ) / 1000 ;
@@ -48,15 +48,21 @@ private ResultSet executeQuery(final String query) throws SQLException {
48
48
return resultSet ;
49
49
}
50
50
51
- private static void closeQuery (final ResultSet resultSet ) {
51
+ private static void closeQuery (final ResultSet resultSet , long now ) {
52
52
Statement statement = null ;
53
53
try { statement = resultSet .getStatement (); } catch (Exception e ) {
54
54
log .error ("Failed to get Statement" , e );
55
55
}
56
- if (resultSet != null ) try { resultSet .close (); } catch (Exception e ) {
56
+ if (resultSet != null ) try {
57
+ resultSet .close ();
58
+ log .info ("ResultSet closed. {}" , now );
59
+ } catch (Exception e ) {
57
60
log .error ("Failed to close ResultSet" , e );
58
61
}
59
- if (statement != null ) try { statement .close (); } catch (Exception e ) {
62
+ if (statement != null ) try {
63
+ statement .close ();
64
+ log .info ("Statement closed. {}" , now );
65
+ } catch (Exception e ) {
60
66
log .error ("Failed to close Statement" , e );
61
67
}
62
68
}
0 commit comments