Thread:
 DB2 and Blobs 
 sgwood   20 May 2008, 21:59 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: sgwood (20 May 2008, 21:59) Replies: 0, Views: 808
Subject: DB2 and Blobs
Working with Hibernate + Blobs against DB2 databases, you need to be
careful with the JDBC connection settings.

When reading the blob, you can get:


com.ibm.db2.jcc.b.SqlException: [jcc][10120][11936][3.50.152] Invalid
operation: Lob is closed. ERRORCODE=-4470, SQLSTATE=null
	at com.ibm.db2.jcc.b.wc.a(wc.java:55)
	at com.ibm.db2.jcc.b.wc.a(wc.java:93)
	at com.ibm.db2.jcc.b.rd.d(rd.java:67)
	at com.ibm.db2.jcc.b.sd.w(sd.java:202)
	at com.ibm.db2.jcc.b.sd.getBinaryStream(sd.java:107)
	at
org.hibernate.lob.SerializableBlob.getBinaryStream(SerializableBlob.java:39)

This was with DB2 9.5 and the db2jcc driver.

The solution was to follow the advice of
http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14053553
getting to a JDBC connect string like:

jdbc:db2://localhost:50000/testDB:fullyMaterializeLobData=true;fullyMaterializeInputStreams=true;progressiveStreaming=2;progresssiveLocators=2;
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]