title: Grails QuartZ plugin - I/O Error: Connection reset Invalid state, the Connection object is closed
body: <p>Environment - LINUX RHEL, SQL server 2008 R2, Tomcat 6</p>
  
  <p>We have daily job which will retrieve data from external system using REST call and fill it in application database. Job is about to RUN for 5 to 6 hours daily. But the job is not running completely and it terminated in between at any time by throwing the following exception.</p>
  
  <pre><code>2014-08-21 02:58:29,557 [quartzScheduler_Worker-7] ERROR util.JDBCExceptionReporter 
     - I/O Error: Connection reset
  2014-08-21 02:58:29,558 [quartzScheduler_Worker-7] ERROR util.JDBCExceptionReporter 
     - Invalid state, the Connection object is closed.
  2014-08-21 02:58:29,559 [quartzScheduler_Worker-7] INFO core.JobRunShell 
     - Job ALM.cyborg.tracking.ALMAutoSyncJob threw a JobExecutionException:
          org.quartz.JobExecutionException: Hibernate operation: could not inspect JDBC 
          autocommit mode; 
          uncategorized SQLException for SQL [???]; 
          SQL state [HY010]; 
          error code [0]; 
          Invalid state, the Connection object is closed.; 
          nested exception is java.sql.SQLException: 
          Invalid state, the Connection object is closed. 
          [See nested exception: 
             org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: 
             could not inspect JDBC autocommit mode; uncategorized SQLException
             for SQL [???]; 
             SQL state [HY010]; 
             error code [0]; 
             Invalid state, the Connection object is closed.; 
             nested exception is java.sql.SQLException: Invalid state, 
             the Connection object is closed.]
  </code></pre>
  
  <p>But there is no problem in the data base connectivity. Application is running well when this exception is being thrown. We have configured the DBCP properties well in the application <code>datasource.groovy</code>.
  What could be the potential cause? Some days job running for 3 to 4 hours and for some days for an hour and it get terminated in between at any time.</p>