title: I get java.sql.SQLException: The connection does not exist
body: <p>I have this error when I want to make a query, everything works fine in my application until 8 pm but at 3 am when I make a query to the base it responds that the connection does not exist, besides I can not replicate the error in the development environment</p>
  
  <pre><code>2017-04-09 20:23:01 | 6185 | 76 | LogSystemBS | println  &gt;&gt; finalizo proceso 
  de ejecucion de proceso con id= 4 con intentos= 1
  2017-04-10 03:50:41 | 6185 | 5890 | LogSystemBS | println  &gt;&gt; en la funcion 
  configurarFabrica 7887
  2017-04-10 03:50:41 | 6185 | 5890 | LogSystemBS | println  &gt;&gt; en la fabrica del:  fabricaSistemaSeguros
  2017-04-10 03:50:41 | 6185 | 5890 | LogSystemBS | println  &gt;&gt; fecha 10/04/2017
  2017-04-10 03:50:41 | 6185 | 5890 | LogSystemBS | println  &gt;&gt; nueva fecha 20170410
  2017-04-10 03:50:41 | 6185 | 5890 | LogSystemBS | println  &gt;&gt; ****** 
  parametros enviados a entorno*****
  2017-04-10 03:50:41 | 6185 | 5890 | LogSystemBS | println  &gt;&gt; NPE---&gt;048400000083960104217047
  2017-04-10 03:50:41 | 6185 | 5890 | LogSystemBS | println  &gt;&gt; fecha---&gt;20170410
  2017-04-10 03:50:41 | 6185 | 5890 | LogSystemBS | println  &gt;&gt; aviso---&gt;0
  java.sql.SQLException: The connection does not exist.
  at com.ibm.as400.access.JDError.throwSQLException(JDError.java:382)
  at com.ibm.as400.access.AS400JDBCConnection.checkOpen(AS400JDBCConnection.java:387)
  at com.ibm.as400.access.AS400JDBCConnection.send(AS400JDBCConnection.java:2239)
  at com.ibm.as400.access.AS400JDBCStatement.close(AS400JDBCStatement.java:471)
  at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.close(DelegatingStatement.java:168)
  at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.close(DelegatingStatement.java:168)
  at com.hsbc.sv.desarrollo.interconexion.impl.jdbcbasico.ServicioJDBCResultSet.ejecutar(ServicioJDBCResultSet.java:82)
  at com.hsbc.sv.desarrollo.interconexion.Servicio.invocar(Servicio.java:150)
  at com.hsbc.sv.desarrollo.interconexion.FabricaServicios.operacion(FabricaServicios.java:410)
  at com.hsbc.sv.desarrollo.interconexion.FabricaServicios.obtenerDatos(FabricaServicios.java:357)
  at com.hsbc.sv.desarrollo.interconexion.remoto.Escuchador.obtenerResultados(Escuchador.java:42)
  at com.j2ee.sv.j2entorno.escuchador.servlets.http.OperacionesEscuchador$2.operacion(OperacionesEscuchador.java:61)
  at com.j2ee.sv.j2entorno.escuchador.servlets.http.EscuchadorHTTPEntorno.doPost(EscuchadorHTTPEntorno.java:58)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
  at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
  at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
  at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:626)
  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
  at java.lang.Thread.run(Thread.java:780)
  java.sql.SQLException: Already closed.
  at org.apache.tomcat.dbcp.dbcp.PoolableConnection.close(PoolableConnection.java:114)
  at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:191)
  at com.hsbc.sv.desarrollo.interconexion.impl.jdbcbasico.ServicioJDBCResultSet.ejecutar(ServicioJDBCResultSet.java:87)
  at com.hsbc.sv.desarrollo.interconexion.Servicio.invocar(Servicio.java:150)
  at com.hsbc.sv.desarrollo.interconexion.FabricaServicios.operacion(FabricaServicios.java:410)
  at com.hsbc.sv.desarrollo.interconexion.FabricaServicios.obtenerDatos(FabricaServicios.java:357)
  at com.hsbc.sv.desarrollo.interconexion.remoto.Escuchador.obtenerResultados(Escuchador.java:42)
  at com.j2ee.sv.j2entorno.escuchador.servlets.http.OperacionesEscuchador$2.operacion(OperacionesEscuchador.java:61)
  at com.j2ee.sv.j2entorno.escuchador.servlets.http.EscuchadorHTTPEntorno.doPost(EscuchadorHTTPEntorno.java:58)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
  at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
  at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
  at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:626)
  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
  at java.lang.Thread.run(Thread.java:780)
  </code></pre>