@@ -64,7 +64,7 @@ public class RealtimeReporterDao {
64
64
public RealtimeReporterDao (final Connection conn ) {
65
65
this .conn = conn ;
66
66
jdbcTemplate = new JdbcTemplate (new SingleConnectionDataSource (conn , true ));
67
- jdbcTemplate .setFetchSize (1 );
67
+ jdbcTemplate .setFetchSize (UtplsqlDao . FETCH_ROWS );
68
68
}
69
69
70
70
public boolean isSupported () {
@@ -143,26 +143,31 @@ public void consumeReport(final String reporterId, final RealtimeReporterEventCo
143
143
sb .append (" ? := l_reporter.get_lines_cursor();\n " );
144
144
sb .append ("END;" );
145
145
final String plsql = sb .toString ();
146
- jdbcTemplate .execute (plsql , new CallableStatementCallback <Void >() {
147
- @ Override
148
- public Void doInCallableStatement (final CallableStatement cs ) throws SQLException {
149
- cs .setString (1 , reporterId );
150
- cs .registerOutParameter (2 , OracleTypes .CURSOR );
151
- cs .execute ();
152
- final ResultSet rs = (ResultSet ) cs .getObject (2 );
153
- while (rs .next ()) {
154
- final String itemType = rs .getString ("item_type" );
155
- final Clob textClob = rs .getClob ("text" );
156
- final String textString = textClob .getSubString (1 , ((int ) textClob .length ()));
157
- final RealtimeReporterEvent event = convert (itemType , textString );
158
- if (event != null ) {
159
- consumer .process (event );
146
+ jdbcTemplate .setFetchSize (1 );
147
+ try {
148
+ jdbcTemplate .execute (plsql , new CallableStatementCallback <Void >() {
149
+ @ Override
150
+ public Void doInCallableStatement (final CallableStatement cs ) throws SQLException {
151
+ cs .setString (1 , reporterId );
152
+ cs .registerOutParameter (2 , OracleTypes .CURSOR );
153
+ cs .execute ();
154
+ final ResultSet rs = (ResultSet ) cs .getObject (2 );
155
+ while (rs .next ()) {
156
+ final String itemType = rs .getString ("item_type" );
157
+ final Clob textClob = rs .getClob ("text" );
158
+ final String textString = textClob .getSubString (1 , ((int ) textClob .length ()));
159
+ final RealtimeReporterEvent event = convert (itemType , textString );
160
+ if (event != null ) {
161
+ consumer .process (event );
162
+ }
160
163
}
164
+ rs .close ();
165
+ return null ;
161
166
}
162
- rs . close ( );
163
- return null ;
164
- }
165
- });
167
+ } );
168
+ } finally {
169
+ jdbcTemplate . setFetchSize ( UtplsqlDao . FETCH_ROWS );
170
+ }
166
171
}
167
172
168
173
public String getHtmlCoverage (final String reporterId ) {
0 commit comments