@@ -64,7 +64,7 @@ public class RealtimeReporterDao {
6464 public RealtimeReporterDao (final Connection conn ) {
6565 this .conn = conn ;
6666 jdbcTemplate = new JdbcTemplate (new SingleConnectionDataSource (conn , true ));
67- jdbcTemplate .setFetchSize (1 );
67+ jdbcTemplate .setFetchSize (UtplsqlDao . FETCH_ROWS );
6868 }
6969
7070 public boolean isSupported () {
@@ -143,26 +143,31 @@ public void consumeReport(final String reporterId, final RealtimeReporterEventCo
143143 sb .append (" ? := l_reporter.get_lines_cursor();\n " );
144144 sb .append ("END;" );
145145 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+ }
160163 }
164+ rs .close ();
165+ return null ;
161166 }
162- rs . close ( );
163- return null ;
164- }
165- });
167+ } );
168+ } finally {
169+ jdbcTemplate . setFetchSize ( UtplsqlDao . FETCH_ROWS );
170+ }
166171 }
167172
168173 public String getHtmlCoverage (final String reporterId ) {
0 commit comments