2 Replies Latest reply on May 14, 2014 1:06 PM by Steven Hawkins

    org.teiid.jdbc.TeiidSQLException: org.teiid.query.sql.lang.BatchedUpdateCommand cannot be cast to org.teiid.query.sql.lang.ProcedureContainer

    gadeyne.bram Master

      Dear,

       

      I'm using Teiid 8.7 and I get this exception. It looks like an exception in the JDBC driver class.

       

      I was executing the following commands (s is a Statement):

       

      s.addBatch("delete from infection_medication;");

      s.addBatch("delete from medication;");

      s.addBatch("delete from infections;");

      s.addBatch("delete from observvalues;");

      s.addBatch("delete from patient_admission;");

      s.addBatch("delete from patient;");

      s.executeBatch();

       

      mei 14, 2014 1:53:03 PM be.ugent.ontal.chest.demo.data.impl.dao.DataCleaner cleanAllData

      SEVERE: Could not clean all data.

      org.teiid.jdbc.TeiidSQLException: org.teiid.query.sql.lang.BatchedUpdateCommand cannot be cast to org.teiid.query.sql.lang.ProcedureContainer

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

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

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

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

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

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

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

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

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

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

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

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

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

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.teiid.net.socket.SocketServerConnectionFactory$ShutdownHandler.invoke(SocketServerConnectionFactory.java:98)

          at com.sun.proxy.$Proxy1.read(Unknown Source)

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

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

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

          at org.teiid.jdbc.StatementImpl.executeBatch(StatementImpl.java:321)

          at be.ugent.ontal.chest.demo.data.impl.dao.DataCleaner.cleanAllData(DataCleaner.java:27)

          at be.ugent.ontal.chest.demo.data.impl.DataGeneratorImpl.deleteAllData(DataGeneratorImpl.java:67)

          at be.ugent.ontal.chest.runnable.ChestTest2StartupRunnable.run(ChestTest2StartupRunnable.java:51)

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

      Caused by: org.teiid.core.TeiidException: org.teiid.query.sql.lang.BatchedUpdateCommand cannot be cast to org.teiid.query.sql.lang.ProcedureContainer

          at org.teiid.client.ResultsMessage.setException(ResultsMessage.java:194)

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

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

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

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

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

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

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

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

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

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

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

      Caused by: java.lang.ClassCastException: org.teiid.query.sql.lang.BatchedUpdateCommand cannot be cast to org.teiid.query.sql.lang.ProcedureContainer

          at org.teiid.dqp.internal.process.DataTierTupleSource.checkForUpdates(DataTierTupleSource.java:223)

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

          at org.teiid.query.processor.relational.BatchedUpdateNode.nextBatchDirect(BatchedUpdateNode.java:135)

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

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

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

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

          at org.teiid.query.processor.BatchedUpdatePlan.nextBatch(BatchedUpdatePlan.java:151)

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

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

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

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

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

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

          ... 8 more

       

       

      Executing it like this works fine:

       

      s.executeUpdate("delete from infection_medication;");

      s.executeUpdate("delete from medication;");

      s.executeUpdate("delete from infections;");

      s.executeUpdate("delete from observvalues;");

      s.executeUpdate("delete from patient_admission;");

      s.executeUpdate("delete from patient;");