db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Narayanan <V.Naraya...@Sun.COM>
Subject Re: NPE getting length of Blob
Date Tue, 04 Mar 2008 11:36:17 GMT
Daniel Noll wrote:
> Hi all.
> I have someone seeing the following error under both and
> java.lang.NullPointerException
> 	at org.apache.derby.client.am.PreparedStatement.setIntX(Unknown Source)
> 	at org.apache.derby.client.am.CallableLocatorProcedures.blobGetLength(Unknown 
> Source)
> 	at org.apache.derby.client.am.Blob.getLocatorLength(Unknown Source)
> 	at org.apache.derby.client.am.Lob.sqlLength(Unknown Source)
> 	at org.apache.derby.client.am.Blob.length(Unknown Source)
> Has anyone seen something like this before?  What is the cause of the problem?  
> The exact same code on the exact same version of Derby doesn't cause the same 
> problem over here; could it be something which only happens when unusual 
> network conditions are happening, or something which only happens when the 
> database meets a certain condition?
> Daniel
I have tried getting a blob from a result set and tried the length() 
method on it after the following

1) Closing the connection
2) committing the transaction
3) Rolling back the transaction

In the above three I got the expected SQLState.

4) Tried shutting down the network server just before blob.length I get 
the following

Exception in thread "main" java.sql.SQLNonTransientConnectionException: 
Insufficient data while reading from the network - expected a minimum of 
6 bytes and received only -1 bytes. The connection has been terminated.
at org.apache.derby.client.am.Blob.length(Blob.java:141)
at javaapplication2.Main.main(Main.java:31)

None of the above scenarios seem to be giving the exception pointed out.


View raw message