Unable to execute batch upsert in prepared statement
kulbhushanc Jun 22, 2018 9:15 AMHi,
I am getting exception when performing upsert using prepared statement batch.
teiid version: 9.1.3
jboss version: Wildfly 10.0.0
teiid AdminShell: 9.1.3
Scenario:
I am trying to perform upsert in batch. If batch size is 1, it executes well.
If its is greater than 1, then it throw below exception.
Stack Trace:
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.PreparedStatementImpl.executeBatch(PreparedStatementImpl.java:251)
at com.mySql.WithTeiid.executeSelect(WithTeiid.java:199)
at com.mySql.WithTeiid.main(WithTeiid.java:83)
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.PreparedStatementImpl.executeBatch(PreparedStatementImpl.java:251)
at com.bitwise.mySql.WithTeiid.executeSelect(WithTeiid.java:199)
at com.bitwise.mySql.WithTeiid.main(WithTeiid.java:83)
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