db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mamta A. Satoor (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6214) PreparedStatement.setObject(int, Object, Types.CLOB) fail with DerbyNet
Date Fri, 24 May 2013 05:43:32 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13666014#comment-13666014

Mamta A. Satoor commented on DERBY-6214:

Also, I found that client server case creates ReaderToUTF8Stream objects but embedded case
does not create them.
In case of network server, we come to following to create ReaderToUTF8Stream when client code
executes the prepared statement (after setting the prepared statment parameter values)
Thread [DRDAConnThread_2] (Suspended (breakpoint at line 836 in EmbedPreparedStatement))	
	EmbedPreparedStatement40(EmbedPreparedStatement).setCharacterStreamInternal(int, Reader,
boolean, long) line: 836	
	EmbedPreparedStatement40(EmbedPreparedStatement).setCharacterStream(int, Reader) line: 1815

	DRDAConnThread.setAsCharacterStream(DRDAStatement, int, EXTDTAReaderInputStream, boolean,
String) line: 9453	
	DRDAConnThread.readAndSetExtParam(int, DRDAStatement, int, int, boolean) line: 5328	
	DRDAConnThread.readAndSetAllExtParams(DRDAStatement, boolean) line: 5257	
	DRDAConnThread.parseEXCSQLSTTobjects(DRDAStatement) line: 4509	
	DRDAConnThread.parseEXCSQLSTT() line: 4325	
	DRDAConnThread.processCommands() line: 1064	
	DRDAConnThread.run() line: 298	

But in case of embedded, we do not create ReaderToUTF8Stream objects, instead following gets
executed when the test program issues ps.setString(1,new String(c)) with large string
	SQLClob(SQLChar).setValue(String) line: 1496	
	EmbedPreparedStatement40(EmbedPreparedStatement).setString(int, String) line: 538	

> PreparedStatement.setObject(int, Object, Types.CLOB) fail with DerbyNet
> -----------------------------------------------------------------------
>                 Key: DERBY-6214
>                 URL: https://issues.apache.org/jira/browse/DERBY-6214
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions:,
>            Reporter: Rong Qu
>            Assignee: Mamta A. Satoor
>         Attachments: Derby6214.java, Derby6214_setup.sql, Derby6214_ver2.java, derby.log,
> The issue is specific to the DerbyNet client driver, and doesn't seem to occur using
embedded Derby.
>  "PreparedStatement.setObject(int, Object, Types.CLOB)". It seems to be a problem updating
a CLOB column with a parameterized value using the DerbyNet client driver, and if the update
SQL ends up updating more than one row. I attached a simple test case that just uses JDBC
to reproduce the error. The exception looks like this:
> org.apache.derby.client.am.BatchUpdateException: Non-atomic batch failure.  The batch
was submitted, but at least one exception occurred on an individual member of the batch. Use
getNextException() to retrieve the exceptions for specific batched elements.
>     at org.apache.derby.client.am.Agent.endBatchedReadChain(Unknown Source)
>     at org.apache.derby.client.am.PreparedStatement.executeBatchRequestX(Unknown Source)
>     at org.apache.derby.client.am.PreparedStatement.executeBatchX(Unknown Source)
>     at org.apache.derby.client.am.PreparedStatement.executeBatch(Unknown Source)
>     ...
> Caused by: org.apache.derby.client.am.SqlException: Error for batch element #0: An unexpected
exception was thrown
>     at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>     at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>     at org.apache.derby.client.net.NetStatementReply.readExecute(Unknown Source)
>     at org.apache.derby.client.net.StatementReply.readExecute(Unknown Source)
>     at org.apache.derby.client.net.NetPreparedStatement.readExecute_(Unknown Source)
>     at org.apache.derby.client.am.PreparedStatement.readExecute(Unknown Source)
>     ... 4 more
> Caused by: org.apache.derby.client.am.SqlException: Error for batch element #0: Java
exception: 'Stream has already been read and end-of-file reached and cannot be re-used.: java.io.EOFException'.
>     at org.apache.derby.client.am.SqlException.<init>(Unknown Source)
>     at org.apache.derby.client.am.SqlException.<init>(Unknown Source)
>     ... 10 more

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message