db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <Kristian.Waa...@Sun.COM>
Subject Re: cannot invoke other java.sql.Clob
Date Tue, 22 Jul 2008 09:44:18 GMT
Daniel Noll wrote:
> Hi all.
> I have someone getting an error like this on the client driver v10.4.1.3.
>> 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)
> The column is a CLOB but we're accessing it as a string.
> I've seen forum posts and such in the past where rs.next() would cause 
> the blob to be unusable, but we're doing all the gets inside a method 
> and not calling next until after the method exits.  Certainly no 
> rollback is occurring, and I don't see an error either side of this 
> error which would indicate a need to rollback.
> I can't appear to reproduce the issue at all on my own computer of course.
> Is it possible there is a bug in Derby itself which only occurs in some 
> situations?  I mean, we're just calling getString(), and I wanted to 
> assume that internally it would manage the blob correctly.


Several issues related to Clobs (and Blobs) have been identified.
Some of these were introduced when Derby started using locators in 10.3, 
others are merely existing bugs occurring more frequently with the new 

I'm one of those working in this area of the code at the moment, 
currently with performance regressions. I hope we will get in several 
important fixes in 10.4.2 - both performance improvements and stability 

Regarding the problem you mention above, I think similar issues might 
have been logged already. I'll keep my eyes open, and maybe someone else 
remembers the Jira issue.
Providing any of the following information could help:
  a) Is there an error in derby.log on the server side?
    (maybe try running with derby.stream.error.logSeverityLevel=0)
  b) What does the SQL query look like?
  c) Can you verify the Derby version, both for the client and the server?

If you don't get the answers you need on this list, I suggest you log a 
Jira issue at https://issues.apache.org/jira/browse/DERBY

BTW: Can you say how big the Clobs in your database are? (approx, or on 


> Daniel

View raw message