db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kashyup <va...@quantum4d.com>
Subject Hibernate + Derby - Unable to determine stream header for hibernate type 'text'
Date Thu, 18 Jun 2009 22:05:21 GMT

Hello all,
We have just started to look into Derby as our embedded DB for a desktop app
version.

Env: Hibernate 3.2 and Derby 10.5.1

I have defined a java string field of type 'text' in Hibernate Mapping
(works great on Postgres 8.1 and Oracle 10g)

I use Hibernate SessionFactory to generate Table schema, which is done
without any error.

But, when I try to save records in tables via Hibernate Session, I get the
following exception:
Note: If I change hibernate mapping to type 'string', then I dont get this
error:

java.lang.IllegalStateException: No context, unable to determine which
stream header format to generate
	at
org.apache.derby.iapi.types.ClobStreamHeaderGenerator.determineMode(Unknown
Source)
	at
org.apache.derby.iapi.types.ClobStreamHeaderGenerator.expectsCharCount(Unknown
Source)
	at org.apache.derby.iapi.types.ReaderToUTF8Stream.fillBuffer(Unknown
Source)
	at org.apache.derby.iapi.types.ReaderToUTF8Stream.read(Unknown Source)
	at java.io.DataInputStream.read(Unknown Source)
	at org.apache.derby.iapi.types.SQLClob.readExternal(Unknown Source)
	at org.apache.derby.iapi.types.SQLChar.getString(Unknown Source)
	at org.apache.derby.iapi.types.SQLClob.getClone(Unknown Source)
	at org.apache.derby.impl.sql.GenericParameter.getClone(Unknown Source)
	at org.apache.derby.impl.sql.GenericParameterValueSet.<init>(Unknown
Source)
	at org.apache.derby.impl.sql.GenericParameterValueSet.getClone(Unknown
Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.addBatch(Unknown
Source)
	at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:31)
	at
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2252)
	at
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2665)

Also, I need to save it as type 'text' even though it gets saved as
CLOB(255), as the CLOB column size can later be altered.

What could be the cause? or changes needed?

thanks all


-- 
View this message in context: http://www.nabble.com/Hibernate-%2B-Derby---Unable-to-determine-stream-header-for-hibernate-type-%27text%27-tp24099674p24099674.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Mime
View raw message