Hang When Executing a Batch Which is Made of Two Prepared Clob Inserts (Doc ID 302803.1)

Last updated on AUGUST 03, 2016

Applies to:

JDBC - Version: 9.2.0.6 to 10.1.0.4
This problem can occur on any platform.

Symptoms

An application using the oracle JDBC thin driver, version 10.1.0.3 hangs when executing a batch which is made of two prepared inserts statement.

The two inserts statement in the batch just consists of inserting a clob (one clob < 4000, another one > 4000).

The sequence of code is the following:

...
String sql = "INSERT INTO test (aClob) VALUES (?)";
stmt = conn.prepareStatement(sql);
stmt.setCharacterStream(1, createClobData(3999, 'a'), 3999);
stmt.addBatch();
stmt.setCharacterStream(1, createClobData(4001, 'b'), 4001);
stmt.addBatch();
stmt.executeBatch();
...

 The Java Stack Trace shows that it hangs when executing the batch.The application is waiting on a socket read:

at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java)


Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms