3 Replies Latest reply on Mar 22, 2017 8:27 AM by Steven Hawkins

    Unable to execute batch update on oracle database with jdbc Statement.

    Kulbhushan Chaskar Master

      Hi,

       

      I am getting different behavior when performing update using batch on oralce and mysql database.

      teiid version: 9.1.3

      jboss version: Wildfly 10.0.0

       

      Scenario:

      In case of Mysql:

      I am able to insert a records when a batch contains both duplicate and non-duplicate records

      In case of oracle:

      It only throws exception for violating duplicate key constrains and non-duplicate record insertion also fails

       

      both scenario throws the exception, the stack trace as below.

       

      Stack Trace:

       

      Mar 20, 2017 8:09:42 PM org.teiid.net.socket.SocketServerInstanceImpl exceptionOccurred

      WARNING: Unable to read: unexpected exception

      java.io.OptionalDataException

        at java.io.ObjectInputStream.readObject0(Unknown Source)

        at java.io.ObjectInputStream.readObject(Unknown Source)

        at org.teiid.client.ResultsMessage.readExternal(ResultsMessage.java:286)

        at java.io.ObjectInputStream.readExternalData(Unknown Source)

        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)

        at java.io.ObjectInputStream.readObject0(Unknown Source)

        at java.io.ObjectInputStream.readObject(Unknown Source)

        at org.teiid.net.socket.Message.readExternal(Message.java:56)

        at java.io.ObjectInputStream.readExternalData(Unknown Source)

        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)

        at java.io.ObjectInputStream.readObject0(Unknown Source)

        at java.io.ObjectInputStream.readObject(Unknown Source)

        at org.teiid.netty.handler.codec.serialization.ObjectDecoderInputStream.readObjectOverride(ObjectDecoderInputStream.java:108)

        at java.io.ObjectInputStream.readObject(Unknown Source)

        at org.teiid.net.socket.OioOjbectChannelFactory$OioObjectChannel.read(OioOjbectChannelFactory.java:117)

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

        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:405)

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

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

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

        at com.test.mySql.WithTeiid.executeSqlInBatch(WithTeiid.java:429)

        at com.test.mySql.WithTeiid.main(WithTeiid.java:58)

       

       

      org.teiid.jdbc.TeiidSQLException: org.teiid.net.socket.SingleInstanceCommunicationException

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

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

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

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

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

        at com.test.mySql.WithTeiid.executeSqlInBatch(WithTeiid.java:429)

        at com.test.mySql.WithTeiid.main(WithTeiid.java:58)

      Caused by: org.teiid.net.socket.SingleInstanceCommunicationException

        at org.teiid.net.socket.SocketServerInstanceImpl.exceptionOccurred(SocketServerInstanceImpl.java:226)

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

        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:405)

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

        ... 4 more

      Caused by: java.io.OptionalDataException

        at java.io.ObjectInputStream.readObject0(Unknown Source)

        at java.io.ObjectInputStream.readObject(Unknown Source)

        at org.teiid.client.ResultsMessage.readExternal(ResultsMessage.java:286)

        at java.io.ObjectInputStream.readExternalData(Unknown Source)

        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)

        at java.io.ObjectInputStream.readObject0(Unknown Source)

        at java.io.ObjectInputStream.readObject(Unknown Source)

        at org.teiid.net.socket.Message.readExternal(Message.java:56)

        at java.io.ObjectInputStream.readExternalData(Unknown Source)

        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)

        at java.io.ObjectInputStream.readObject0(Unknown Source)

        at java.io.ObjectInputStream.readObject(Unknown Source)

        at org.teiid.netty.handler.codec.serialization.ObjectDecoderInputStream.readObjectOverride(ObjectDecoderInputStream.java:108)

        at java.io.ObjectInputStream.readObject(Unknown Source)

        at org.teiid.net.socket.OioOjbectChannelFactory$OioObjectChannel.read(OioOjbectChannelFactory.java:117)

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

        ... 12 more

       

      Thanks,

      Kulbhushan Chaskar.