5 Replies Latest reply on Jul 25, 2019 11:10 AM by Ramesh Reddy

    TEIID request is getting terminated

    Pranita Gurav Newbie

      I am trying to insert larget number of records in Mysql database via TEIID and my request is getting cancelled. Below is a complete stacktrace. The request gets cancelled after inserting 5-7 Lakh records  in single table of about 12 columns. I am multiple teiid connection through multiple threads (2-3). Not sure if that is the cause. I am using teiid version 9.1.3

       

      TEIID30160 The request YPg+qwgAoyuw.187 has been cancelled.

      at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:131)

      at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:67)

      at org.teiid.jdbc.StatementImpl.postReceiveResults(StatementImpl.java:783)

      at org.teiid.jdbc.StatementImpl.access$100(StatementImpl.java:62)

      at org.teiid.jdbc.StatementImpl$2.onCompletion(StatementImpl.java:581)

      at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:131)

      at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:36)

      at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:75)

      at org.teiid.net.socket.SocketServerInstanceImpl.receivedMessage(SocketServerInstanceImpl.java:281)

      at org.teiid.net.socket.SocketServerInstanceImpl.read(SocketServerInstanceImpl.java:333)

      at org.teiid.net.socket.SocketServerInstanceImpl$RemoteInvocationHandler$1.get(SocketServerInstanceImpl.java:423)

      at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:590)

      at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:420)

      at org.teiid.jdbc.PreparedStatementImpl.executeBatch(PreparedStatementImpl.java:296)

      at tdm.engine.components.outputs.JdbcComponent.write(JdbcComponent.java:52)

      at tdm.engine.akka.actors.DataGenerator.generateAndLoadRecords(DataGenerator.java:259)

      at tdm.engine.akka.actors.DataGenerator.lambda$2(DataGenerator.java:127)

      at akka.japi.pf.UnitCaseStatement.apply(CaseStatements.scala:26)

      at akka.japi.pf.UnitCaseStatement.apply(CaseStatements.scala:21)

      at scala.PartialFunction.applyOrElse(PartialFunction.scala:123)

      at scala.PartialFunction.applyOrElse$(PartialFunction.scala:122)

      at akka.japi.pf.UnitCaseStatement.applyOrElse(CaseStatements.scala:21)

      at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:171)

      at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:172)

      at akka.actor.Actor.aroundReceive(Actor.scala:517)

      at akka.actor.Actor.aroundReceive$(Actor.scala:515)

      at akka.actor.AbstractActor.aroundReceive(AbstractActor.scala:180)

      at akka.actor.ActorCell.receiveMessage(ActorCell.scala:588)

      at akka.actor.ActorCell.invoke(ActorCell.scala:557)

      at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:258)

      at akka.dispatch.Mailbox.run(Mailbox.scala:225)

      at akka.dispatch.Mailbox.exec(Mailbox.scala:235)

      at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)

      at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)

      at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)

      at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

      Caused by: org.teiid.core.TeiidProcessingException: 57014 TEIID30160 The request YPg+qwgAoyuw.187 has been cancelled.

      at org.teiid.dqp.internal.process.RequestWorkItem.addCancelCode(RequestWorkItem.java:1129)

      at org.teiid.dqp.internal.process.RequestWorkItem.sendError(RequestWorkItem.java:1114)

      at org.teiid.dqp.internal.process.RequestWorkItem.close(RequestWorkItem.java:593)

      at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:374)

      at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51)

      at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:275)

      at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:282)

      at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)

      at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)

      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

      at java.lang.Thread.run(Unknown Source)

      Caused by: org.teiid.core.TeiidProcessingException: TEIID30160 The request YPg+qwgAoyuw.187 has been cancelled.

      at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:146)

      at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:114)

      at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:164)

      at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146)

      at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:477)

      at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:349)

      ... 8 more

        • 1. Re: TEIID request is getting terminated
          Ramesh Reddy Master

          Are you sharing the same connection in multiple threads? If, yes, you can not do that, you need to create a separate connection for each thread.

          • 2. Re: TEIID request is getting terminated
            Pranita Gurav Newbie

            I tried with sigle thread and still getting the same error. I have attached complete stack strace. Hope this helps.

             

            Thanks in advance.

             

            org.teiid.jdbc.TeiidSQLException: 57014 Remote org.teiid.core.TeiidProcessingException: 57014 TEIID30563 The request pd5FzdhLSNB+.934 has been cancelled: session terminated

            at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:131)

            at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:67)

            at org.teiid.jdbc.StatementImpl.postReceiveResults(StatementImpl.java:752)

            at org.teiid.jdbc.StatementImpl.access$100(StatementImpl.java:62)

            at org.teiid.jdbc.StatementImpl$2.onCompletion(StatementImpl.java:562)

            at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:131)

            at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:36)

            at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:75)

            at org.teiid.net.socket.SocketServerInstanceImpl.receivedMessage(SocketServerInstanceImpl.java:281)

            at org.teiid.net.socket.SocketServerInstanceImpl.read(SocketServerInstanceImpl.java:333)

            at org.teiid.net.socket.SocketServerInstanceImpl$RemoteInvocationHandler$1.get(SocketServerInstanceImpl.java:423)

            at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:571)

            at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:420)

            at org.teiid.jdbc.PreparedStatementImpl.executeBatch(PreparedStatementImpl.java:266)

            at com.bitwise.tdm.datageneration.internal.entity.TeiidPreparedStatement.executeBatch(TeiidPreparedStatement.java:63)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.insertData(JSONDataGenerationService.java:3571)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.generateAndInsertData(JSONDataGenerationService.java:3425)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.prepareDataAndInsertIntoTbl(JSONDataGenerationService.java:3360)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.generateAndInsertDataForSingleTable(JSONDataGenerationService.java:3189)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.prepareSrcFactryAndGenerateData(JSONDataGenerationService.java:1078)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.generateDataForAllSelectedTblsAndRtrnDataGenCount(JSONDataGenerationService.java:624)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.generateDataForSelectedTable(JSONDataGenerationService.java:269)

            at com.bitwise.tdm.datageneration.internal.delegator.DataGenerationDelegate.generateDataForSelectedTables(DataGenerationDelegate.java:654)

            at com.bitwise.tdm.datageneration.internal.delegator.DataGenerationDelegate.lambda$getConnectionByIds$84(DataGenerationDelegate.java:614)

            at java.util.Optional.ifPresent(Optional.java:159)

            at com.bitwise.common.communication.Either.apply(Either.java:39)

            at com.bitwise.tdm.datageneration.internal.delegator.DataGenerationDelegate.getConnectionByIds(DataGenerationDelegate.java:613)

            at com.bitwise.tdm.datageneration.internal.delegator.DataGenerationDelegate.lambda$null$66(DataGenerationDelegate.java:442)

            at java.util.Optional.ifPresent(Optional.java:159)

            at com.bitwise.common.communication.Either.apply(Either.java:39)

            at com.bitwise.tdm.datageneration.internal.delegator.DataGenerationDelegate.lambda$generateData$67(DataGenerationDelegate.java:441)

            at java.util.Optional.ifPresent(Optional.java:159)

            at com.bitwise.common.communication.Either.apply(Either.java:39)

            at com.bitwise.tdm.datageneration.internal.delegator.DataGenerationDelegate.generateData(DataGenerationDelegate.java:437)

            at com.bitwise.tdm.datageneration.internal.rest.DataGenerationResource.onDataGeneration(DataGenerationResource.java:166)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

            at java.lang.reflect.Method.invoke(Method.java:498)

            at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)

            at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)

            at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)

            at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)

            at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)

            at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)

            at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)

            at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)

            at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:308)

            at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)

            at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)

            at org.glassfish.jersey.internal.Errors.process(Errors.java:315)

            at org.glassfish.jersey.internal.Errors.process(Errors.java:297)

            at org.glassfish.jersey.internal.Errors.process(Errors.java:267)

            at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)

            at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:291)

            at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1140)

            at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:403)

            at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:386)

            at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:334)

            at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)

            at io.dropwizard.jetty.NonblockingServletHolder.handle(NonblockingServletHolder.java:49)

            at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)

            at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:83)

            at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:300)

            at io.dropwizard.jetty.BiDiGzipFilter.doFilter(BiDiGzipFilter.java:134)

            at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

            at io.dropwizard.servlets.ThreadNameFilter.doFilter(ThreadNameFilter.java:29)

            at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

            at io.dropwizard.jersey.filter.AllowedMethodsFilter.handle(AllowedMethodsFilter.java:44)

            at io.dropwizard.jersey.filter.AllowedMethodsFilter.doFilter(AllowedMethodsFilter.java:39)

            at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

            at com.bitwise.security.auth.AuthFilter.authenticate(AuthFilter.java:151)

            at com.bitwise.security.auth.AuthFilter.doFilter(AuthFilter.java:81)

            at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

            at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:259)

            at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:222)

            at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

            at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)

            at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)

            at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)

            at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)

            at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)

            at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

            at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:240)

            at io.dropwizard.jetty.RoutingHandler.handle(RoutingHandler.java:51)

            at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

            at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:95)

            at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

            at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:159)

            at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

            at org.eclipse.jetty.server.Server.handle(Server.java:497)

            at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)

            at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)

            at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)

            at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)

            at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)

            at java.lang.Thread.run(Thread.java:748)

            Caused by: org.teiid.core.TeiidProcessingException: 57014 Remote org.teiid.core.TeiidProcessingException: 57014 TEIID30563 The request pd5FzdhLSNB+.934 has been cancelled: session terminated

            at org.teiid.dqp.internal.process.RequestWorkItem.addCancelCode(RequestWorkItem.java:1180)

            at org.teiid.dqp.internal.process.RequestWorkItem.sendError(RequestWorkItem.java:1161)

            at org.teiid.dqp.internal.process.RequestWorkItem.close(RequestWorkItem.java:608)

            at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:387)

            at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47)

            at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:285)

            at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:277)

            at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)

            at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)

            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

            ... 1 common frames omitted

            Caused by: org.teiid.core.TeiidProcessingException: TEIID30504 Remote org.teiid.core.TeiidProcessingException: TEIID30504 Ram_CLSQL1_3306: Statement cancelled due to client request

            at org.teiid.dqp.internal.process.DataTierTupleSource.exceptionOccurred(DataTierTupleSource.java:397)

            at org.teiid.dqp.internal.process.DataTierTupleSource.nextTuple(DataTierTupleSource.java:157)

            at org.teiid.query.processor.relational.AccessNode.nextBatchDirect(AccessNode.java:401)

            at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:277)

            at org.teiid.query.processor.relational.RelationalPlan.nextBatch(RelationalPlan.java:141)

            at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:148)

            at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:111)

            at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:160)

            at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:142)

            at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:492)

            at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:362)

            ... 8 common frames omitted

            Caused by: org.teiid.core.TeiidException: Remote org.teiid.translator.TranslatorBatchException: Statement cancelled due to client request

            at org.teiid.translator.jdbc.JDBCUpdateExecution.executeTranslatedCommand(JDBCUpdateExecution.java:311)

            at org.teiid.translator.jdbc.JDBCUpdateExecution.execute(JDBCUpdateExecution.java:82)

            at org.teiid.dqp.internal.datamgr.ConnectorWorkItem$1.execute(ConnectorWorkItem.java:433)

            at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:392)

            at sun.reflect.GeneratedMethodAccessor144.invoke(Unknown Source)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

            at java.lang.reflect.Method.invoke(Method.java:498)

            at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:229)

            at com.sun.proxy.$Proxy36.execute(Unknown Source)

            at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:302)

            at org.teiid.dqp.internal.process.DataTierTupleSource.nextTuple(DataTierTupleSource.java:138)

            ... 17 common frames omitted

            Caused by: java.sql.SQLException: Remote java.sql.BatchUpdateException: Statement cancelled due to client request

            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

            at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)

            at com.mysql.jdbc.Util.getInstance(Util.java:387)

            at com.mysql.jdbc.SQLError.createBatchUpdateException(SQLError.java:1160)

            at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1767)

            at com.mysql.jdbc.PreparedStatement.executeBatchInternal(PreparedStatement.java:1257)

            at com.mysql.jdbc.StatementImpl.executeBatch(StatementImpl.java:959)

            at com.mysql.jdbc.jdbc2.optional.StatementWrapper.executeBatch(StatementWrapper.java:649)

            at org.jboss.jca.adapters.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:1180)

            at org.teiid.translator.jdbc.JDBCUpdateExecution.executeTranslatedCommand(JDBCUpdateExecution.java:282)

            ... 27 common frames omitted

            Caused by: com.mysql.jdbc.exceptions.MySQLStatementCancelledException: Remote com.mysql.jdbc.exceptions.MySQLStatementCancelledException: Statement cancelled due to client request

            at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1883)

            at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2073)

            at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1751)

            ... 32 common frames omitted

            2019-07-24 14:05:38,176 [dw-1757 - /api/tdm/datageneration/onDataGeneration - POST /api/tdm/datageneration/onDataGeneration] ERROR c.b.t.d.i.b.JSONDataGenerationService.error(38) - TEIID40042 Invalid Session pd5FzdhLSNB+. Session may have already been terminated.

            org.teiid.jdbc.TeiidSQLException: TEIID40042 Invalid Session pd5FzdhLSNB+. Session may have already been terminated.

            at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:131)

            at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:67)

            at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:579)

            at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:420)

            at org.teiid.jdbc.PreparedStatementImpl.executeBatch(PreparedStatementImpl.java:266)

            at com.bitwise.tdm.datageneration.internal.entity.TeiidPreparedStatement.executeBatch(TeiidPreparedStatement.java:63)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.insertData(JSONDataGenerationService.java:3571)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.generateAndInsertData(JSONDataGenerationService.java:3425)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.prepareDataAndInsertIntoTbl(JSONDataGenerationService.java:3360)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.generateAndInsertDataForSingleTable(JSONDataGenerationService.java:3189)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.prepareSrcFactryAndGenerateData(JSONDataGenerationService.java:1078)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.generateDataForAllSelectedTblsAndRtrnDataGenCount(JSONDataGenerationService.java:624)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.generateDataForSelectedTable(JSONDataGenerationService.java:269)

            at com.bitwise.tdm.datageneration.internal.delegator.DataGenerationDelegate.generateDataForSelectedTables(DataGenerationDelegate.java:654)

            at com.bitwise.tdm.datageneration.internal.delegator.DataGenerationDelegate.lambda$getConnectionByIds$84(DataGenerationDelegate.java:614)

            at java.util.Optional.ifPresent(Optional.java:159)

            at com.bitwise.common.communication.Either.apply(Either.java:39)

            at com.bitwise.tdm.datageneration.internal.delegator.DataGenerationDelegate.getConnectionByIds(DataGenerationDelegate.java:613)

            at com.bitwise.tdm.datageneration.internal.delegator.DataGenerationDelegate.lambda$null$66(DataGenerationDelegate.java:442)

            at java.util.Optional.ifPresent(Optional.java:159)

            at com.bitwise.common.communication.Either.apply(Either.java:39)

            at com.bitwise.tdm.datageneration.internal.delegator.DataGenerationDelegate.lambda$generateData$67(DataGenerationDelegate.java:441)

            at java.util.Optional.ifPresent(Optional.java:159)

            at com.bitwise.common.communication.Either.apply(Either.java:39)

            at com.bitwise.tdm.datageneration.internal.delegator.DataGenerationDelegate.generateData(DataGenerationDelegate.java:437)

            at com.bitwise.tdm.datageneration.internal.rest.DataGenerationResource.onDataGeneration(DataGenerationResource.java:166)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

            at java.lang.reflect.Method.invoke(Method.java:498)

            at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)

            at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)

            at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)

            at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)

            at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)

            at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)

            at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)

            at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)

            at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:308)

            at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)

            at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)

            at org.glassfish.jersey.internal.Errors.process(Errors.java:315)

            at org.glassfish.jersey.internal.Errors.process(Errors.java:297)

            at org.glassfish.jersey.internal.Errors.process(Errors.java:267)

            at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)

            at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:291)

            at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1140)

            at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:403)

            at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:386)

            at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:334)

            at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)

            at io.dropwizard.jetty.NonblockingServletHolder.handle(NonblockingServletHolder.java:49)

            at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)

            at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:83)

            at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:300)

            at io.dropwizard.jetty.BiDiGzipFilter.doFilter(BiDiGzipFilter.java:134)

            at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

            at io.dropwizard.servlets.ThreadNameFilter.doFilter(ThreadNameFilter.java:29)

            at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

            at io.dropwizard.jersey.filter.AllowedMethodsFilter.handle(AllowedMethodsFilter.java:44)

            at io.dropwizard.jersey.filter.AllowedMethodsFilter.doFilter(AllowedMethodsFilter.java:39)

            at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

            at com.bitwise.security.auth.AuthFilter.authenticate(AuthFilter.java:151)

            at com.bitwise.security.auth.AuthFilter.doFilter(AuthFilter.java:81)

            at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

            at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:259)

            at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:222)

            at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

            at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)

            at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)

            at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)

            at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)

            at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)

            at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

            at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:240)

            at io.dropwizard.jetty.RoutingHandler.handle(RoutingHandler.java:51)

            at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

            at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:95)

            at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

            at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:159)

            at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

            at org.eclipse.jetty.server.Server.handle(Server.java:497)

            at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)

            at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)

            at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)

            at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)

            at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)

            at java.lang.Thread.run(Thread.java:748)

            Caused by: org.teiid.client.security.InvalidSessionException: TEIID40042 Invalid Session pd5FzdhLSNB+. Session may have already been terminated.

            at org.teiid.transport.SessionCheckingProxy.invoke(SessionCheckingProxy.java:58)

            at com.sun.proxy.$Proxy26.executeRequest(Unknown Source)

            at sun.reflect.GeneratedMethodAccessor131.invoke(Unknown Source)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

            at java.lang.reflect.Method.invoke(Method.java:498)

            at org.teiid.transport.ServerWorkItem.run(ServerWorkItem.java:83)

            at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:277)

            at org.teiid.transport.SocketClientInstance.processMessagePacket(SocketClientInstance.java:234)

            at org.teiid.transport.SocketClientInstance.receivedMessage(SocketClientInstance.java:219)

            at org.teiid.transport.SSLAwareChannelHandler.messageReceived(SSLAwareChannelHandler.java:211)

            at org.teiid.transport.SSLAwareChannelHandler.channelRead(SSLAwareChannelHandler.java:217)

            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)

            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)

            at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)

            at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)

            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)

            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)

            at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)

            at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)

            at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)

            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)

            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)

            at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)

            at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)

            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)

            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)

            at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)

            at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)

            at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:624)

            at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:559)

            at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:476)

            at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)

            at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)

            ... 1 common frames omitted

            2019-07-24 14:05:38,436 [dw-1757 - /api/tdm/datageneration/onDataGeneration - POST /api/tdm/datageneration/onDataGeneration] ERROR c.b.t.d.i.b.JSONDataGenerationService.error(38) - TEIID40041 Invalid null Session

            org.teiid.jdbc.TeiidSQLException: TEIID40041 Invalid null Session

            at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:131)

            at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:67)

            at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:579)

            at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:420)

            at org.teiid.jdbc.PreparedStatementImpl.executeBatch(PreparedStatementImpl.java:266)

            at com.bitwise.tdm.datageneration.internal.entity.TeiidPreparedStatement.executeBatch(TeiidPreparedStatement.java:63)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.insertData(JSONDataGenerationService.java:3571)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.generateAndInsertData(JSONDataGenerationService.java:3425)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.prepareDataAndInsertIntoTbl(JSONDataGenerationService.java:3360)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.generateAndInsertDataForSingleTable(JSONDataGenerationService.java:3189)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.prepareSrcFactryAndGenerateData(JSONDataGenerationService.java:1078)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.generateDataForAllSelectedTblsAndRtrnDataGenCount(JSONDataGenerationService.java:624)

            at com.bitwise.tdm.datageneration.internal.business.JSONDataGenerationService.generateDataForSelectedTable(JSONDataGenerationService.java:269)

            at com.bitwise.tdm.datageneration.internal.delegator.DataGenerationDelegate.generateDataForSelectedTables(DataGenerationDelegate.java:654)

            at com.bitwise.tdm.datageneration.internal.delegator.DataGenerationDelegate.lambda$getConnectionByIds$84(DataGenerationDelegate.java:614)

            at java.util.Optional.ifPresent(Optional.java:159)

            at com.bitwise.common.communication.Either.apply(Either.java:39)

            at com.bitwise.tdm.datageneration.internal.delegator.DataGenerationDelegate.getConnectionByIds(DataGenerationDelegate.java:613)

            at com.bitwise.tdm.datageneration.internal.delegator.DataGenerationDelegate.lambda$null$66(DataGenerationDelegate.java:442)

            at java.util.Optional.ifPresent(Optional.java:159)

            at com.bitwise.common.communication.Either.apply(Either.java:39)

            at com.bitwise.tdm.datageneration.internal.delegator.DataGenerationDelegate.lambda$generateData$67(DataGenerationDelegate.java:441)

            at java.util.Optional.ifPresent(Optional.java:159)

            at com.bitwise.common.communication.Either.apply(Either.java:39)

            at com.bitwise.tdm.datageneration.internal.delegator.DataGenerationDelegate.generateData(DataGenerationDelegate.java:437)

            at com.bitwise.tdm.datageneration.internal.rest.DataGenerationResource.onDataGeneration(DataGenerationResource.java:166)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

            at java.lang.reflect.Method.invoke(Method.java:498)

            • 3. Re: TEIID request is getting terminated
              Ramesh Reddy Master

              You are using the Teiid Embedded, right? Also looks like in the servlet env, This exception is different from above. Looks like your client code somewhere it tries to close connection and then use that connection again, or you have two concurrent requests using same connection and one of them closing the connection out before other is finished. As I was mentioning in the previous comment, the connection object is not thread safe and can not be shared.

              • 4. Re: TEIID request is getting terminated
                Pranita Gurav Newbie

                Looks like I am having couple of issues here. Do you have idea about the first exception I gave above. I am trying to add data in batches of 1000. I even tried with 10000 but same issue. The error message is not much discriptive

                 

                at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)

                at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

                Caused by: org.teiid.core.TeiidProcessingException: 57014 TEIID30160 The request NWUi1nD4iwQ/.208 has been cancelled.

                at org.teiid.dqp.internal.process.RequestWorkItem.addCancelCode(RequestWorkItem.java:1129)

                at org.teiid.dqp.internal.process.RequestWorkItem.sendError(RequestWorkItem.java:1114)

                at org.teiid.dqp.internal.process.RequestWorkItem.close(RequestWorkItem.java:593)

                at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:374)

                 

                 

                I will try out your suggestion on second one.

                • 5. Re: TEIID request is getting terminated
                  Ramesh Reddy Master

                  They are stem from the same issue, the connection is being closed, when that happens then any pending requests get cancelled. I asking you check where you are closing the connection, then overaall the connection usage itself across multiple requests