Advanced Reporting - Jaspersoft Query Timeout Needs to be Adjusted

Document ID : KB000031776
Last Modified Date : 14/02/2018
Show Technical Document Details

Error Message:

"net.sf.jasperreports.engine.JRException:

Unable to get next record" and "java.sql.SQLRecoverableException: Closed Connection:

               next" are related to Tomcat understanding that the connection was abandoned.

The Jaspersoft Catalina log shows an "org.apache.tomcat.jdbc.pool.ConnectionPool abandon" message.

This can happen if the query is returning a massive amount of records in a time frame that is longer than what is configured in tomcat as the "abandoned timeout".

 

Resolution:

Please change the following parameters in the <JaspersoftTomcatInstallFolder>/webapps/reportservice/WEB-INF/applicationContext-proxyDataSourcePoolClarity.xml

               (<JasperSoft>/webapps/reportservice/WEB-INF)

               <bean id="dwhTntPoolProperties" class="org.apache.tomcat.jdbc.pool.PoolProperties" scope="prototype">

               ....

               <property name="removeAbandonedTimeout" value="12000"/>

              

Change from 120 to 12000 as shown below: 

               <bean id="ppmTntPoolProperties" class="org.apache.tomcat.jdbc.pool.PoolProperties" scope="prototype">

               ....

               <property name="removeAbandonedTimeout" value="12000"/>

              

Note: removeAbandonedTimeout - (int) Timeout in seconds before an abandoned(in use) connection can be removed.

The default value is 60 (60 seconds).

 

The value should be set to the longest running query your reports might have. 

Please restart the Jaspersoft Tomcat service after making this change.