You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Trejkaz (JIRA)" <ji...@apache.org> on 2014/05/11 00:14:36 UTC

[jira] [Commented] (DERBY-3862) "You cannot invoke other java.sql.Clob/java.sql.Blob methods" on calling Result#getString for Clob column

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

Trejkaz commented on DERBY-3862:
--------------------------------

Also exhibited in 10.9.1.0 on some databases but not all.


> "You cannot invoke other java.sql.Clob/java.sql.Blob methods" on calling Result#getString for Clob column
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3862
>                 URL: https://issues.apache.org/jira/browse/DERBY-3862
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.4.1.3
>            Reporter: Trejkaz
>
> I have seen this error a couple of times on the client driver v10.4.1.3 (server is also v10.4.1.3 if it matters):
>     java.sql.SQLException: You cannot invoke other java.sql.Clob/java.sql.Blob methods after calling the free() method or after the Blob/Clob's transaction has been committed or rolled back.
>             at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:46)
>             at org.apache.derby.client.am.SqlException.getSQLException(SqlException.java:362)
>             at org.apache.derby.client.am.Clob.length(Clob.java:239)
>             at org.apache.derby.client.am.Cursor.getString(Cursor.java:1035)
>             at org.apache.derby.client.am.ResultSet.getString(ResultSet.java:1069)
>             at org.apache.derby.client.am.ResultSet.getString(ResultSet.java:1661)
>             at (our code)
> DERBY-3583 notes the error message for the same usage but that is for multiple calls -- this is happening on the *first* call to getString for that column.
> Autocommit is off -- all access to the database in our code is funneled through one place, we set it to false immediately after getting it from the pool and there are no other calls to it.
> I have looked at another place in our code where we are getting a Clob as a string and in that place we are using the character stream and reading that to a string, and not closing it, which in itself is suspicious but maybe there is a reason.  There is no comment saying why we're not using getString, but it might be because of this issue.  Will be investigating that lead some more shortly.



--
This message was sent by Atlassian JIRA
(v6.2#6252)