Inserting into a table and returning the clob locator (oracle) from a
stored procedure and then writing to the clob outputstream and
calling flush on the stream worked in 3.0.4. In 3.2.1 it no longer works,
rather the following error is returned:
Caused by: java.io.IOException: ORA-22990: LOB locators cannot span transactions
at oracle.jdbc.dbaccess.DBError.SQLToIOException(DBError.java:716)
at oracle.jdbc.driver.OracleClobWriter.flushBuffer(OracleClobWriter.java:270)
at oracle.jdbc.driver.OracleClobWriter.flush(OracleClobWriter.java:204)
.....
and the java code is:
//
CallableStatement stmt =
(CallableStatement) conn.prepareCall(".....");
// set IN parameters here and define clob OUT paremeter
// insert new row and return clob locator
stmt.execute();
CLOB clob = (CLOB)stmt.getClob(n);
Writer writer = clob.getCharacterOutputStream();
String clobString = mybean.getClobValue();
writer.write(clobString);
writer.flush(); // <-where the exception is thrown
writer.close();
In 3.0.4 the connection autocommit was true?!? and it also is true
running with 3.2.1.
RME