We've recently migrated from Oracle 9i to Oracle 10g, and Java code that used to work now causes Oracle to hang.
The code involves inserting a CLOB into a database.
We first insert many other values and an EMPTY_CLOB(), as in the following:
This statement works fine. We then try to insert the CLOB.
A typical value of query is:
This code works fine in Oracle 9i, but in Oracle 10g, Oracle hangs, and we find a lock on the row in the table that we are trying to update.
Some Googling revealed that Oracle 10g has a more efficient way of inserting CLOBs. We set the value of connectionProperties to SetBigStringTryClob=true in the XML that defines DataSource for the JDBC driver, and we used the following code to try to insert the CLOB:
But Oracle still hangs.
We haven't had any problems inserting BLOBs, VARCHAR2s, and other data types into the table. The code for BLOBs is pretty much the same as the original CLOB code, and it works fine.
Hello, I'm having the same hanging issue when inserting a clob into a 10g db using a Preparedstatement. I see the question posted all over the web without a solution. Has anyone come up with a resolution?
I posted that query a long time ago, so I'm not sure, but I *think* that the solution was to change the Oracle JDBC Driver to ojdbc14.jar. See this page for downloads. Some of the drivers that Oracle provides have bugs.