Announcement

Collapse
No announcement yet.

Wrapped java.sql.SQLException: ResultSet is closed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wrapped java.sql.SQLException: ResultSet is closed

    Hi everybody. I am trying to count the number of rows in my database after everytime I write to it to make sure that it's been written. I am doing that because I have noticed that I may choose to copy 500obxs in an HL7 file and may be 3 or 4 are skipped. I don't know if it is the driver messing up or the server is slower than Mirth. This only happens when I am writing lots of rows. So I decided to count the number of rows everytime I write to see if it increased. here is my code:

    Code:
    var dbConn = DatabaseConnectionFactory.createDatabaseConnection('net.sourceforge.jtds.jdbc.Driver','jdbc:odbc:«»Driver={SQL Server};Server=ServerName;Database=DatabaseName','Username','password');
    
    
    var result;
    result = dbConn.executeQuery("SELECT COUNT(*) FROM TestTable"«»);
    var numberofrows;
    while(result.next())
    {
       numberofrows = result.getInt(1);
    }
    I gives this error
    ERROR-300: Transformer error
    ERROR MESSAGE: Error evaluating transformer
    com.webreach.mirth.server.MirthJavascriptTransform erException:
    CHANNEL: FileToDataBase Transfer
    CONNECTOR: Destination 1
    SCRIPT SOURCE:
    LINE NUMBER: 9
    DETAILS: Wrapped java.sql.SQLException: ResultSet is closed
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateScript(JavaScriptTransform er.java:397)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:307)
    at org.mule.transformers.AbstractEventAwareTransforme r.doTransform(AbstractEventAwareTransformer.java:4 8)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
    at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
    at com.webreach.mirth.server.controllers.MessageObjec tController.getMessageObjectFromEvent(MessageObjec tController.java:507)
    at com.webreach.mirth.connectors.jdbc.JdbcMessageDisp atcher.doDispatch(JdbcMessageDispatcher.java:76)
    at com.webreach.mirth.connectors.jdbc.JdbcMessageDisp atcher.doSend(JdbcMessageDispatcher.java:157)
    at org.mule.providers.AbstractMessageDispatcher.send( AbstractMessageDispatcher.java:166)
    at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:191)
    at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:130)
    at org.mule.routing.outbound.AbstractOutboundRouter.s end(AbstractOutboundRouter.java:85)
    at org.mule.routing.outbound.FilteringMulticastingRou ter.route(FilteringMulticastingRouter.java:89)
    at org.mule.routing.outbound.OutboundMessageRouter$1. doInTransaction(OutboundMessageRouter.java:78)
    at org.mule.transaction.TransactionTemplate.execute(T ransactionTemplate.java:48)
    at org.mule.routing.outbound.OutboundMessageRouter.ro ute(OutboundMessageRouter.java:82)
    at org.mule.impl.model.DefaultMuleProxy.onCall(Defaul tMuleProxy.java:247)
    at org.mule.impl.model.seda.SedaComponent.doSend(Seda Component.java:209)
    at org.mule.impl.model.AbstractComponent.sendEvent(Ab stractComponent.java:277)
    at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:201)
    at org.mule.routing.inbound.InboundMessageRouter.send (InboundMessageRouter.java:161)
    at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:128)
    at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:493)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:272)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:231)
    at com.webreach.mirth.connectors.file.FileMessageRece iver.processFile(FileMessageReceiver.java:236)
    at com.webreach.mirth.connectors.file.FileMessageRece iver.poll(FileMessageReceiver.java:138)
    at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:118)
    at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.sql.SQLException: ResultSet is closed
    at sun.jdbc.odbc.JdbcOdbcResultSet.checkOpen(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcResultSet.next(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.mozilla.javascript.MemberBox.invoke(MemberBox. java:142)
    at org.mozilla.javascript.NativeJavaMethod.call(Nativ eJavaMethod.java:201)
    at org.mozilla.javascript.optimizer.OptRuntime.callPr op0(OptRuntime.java:117)
    at org.mozilla.javascript.gen.c190._c13(c67e1c14-6ac3-419d-aec2-93d893fd3c53:14)
    at org.mozilla.javascript.gen.c190.call(c67e1c14-6ac3-419d-aec2-93d893fd3c53)
    at org.mozilla.javascript.optimizer.OptRuntime.callNa me0(OptRuntime.java:106)
    at org.mozilla.javascript.gen.c190._c0(c67e1c14-6ac3-419d-aec2-93d893fd3c53:290)
    at org.mozilla.javascript.gen.c190.call(c67e1c14-6ac3-419d-aec2-93d893fd3c53)
    at org.mozilla.javascript.ContextFactory.doTopCall(Co ntextFactory.java:337)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(Scr iptRuntime.java:2755)
    at org.mozilla.javascript.gen.c190.call(c67e1c14-6ac3-419d-aec2-93d893fd3c53)
    at org.mozilla.javascript.gen.c190.exec(c67e1c14-6ac3-419d-aec2-93d893fd3c53)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateScript(JavaScriptTransform er.java:352)
    ... 31 more


    Any Help

  • #2
    Re:Wrapped java.sql.SQLException: ResultSet is closed

    Does anyone know the solution to this problem.

    Thanks.

    Comment


    • #3
      Re:Wrapped java.sql.SQLException: ResultSet is closed

      Does anyone know the solution to this problem.

      Thanks.

      Comment

      Working...
      X