-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate > CLOB > Oracle :(
PostPosted: Fri Dec 04, 2009 3:43 pm 
Newbie

Joined: Fri Dec 04, 2009 3:38 pm
Posts: 2
I am trying to write to an Oracle clob field a value over 4000 characters. This seams to be a common issue but non of the solutions seem to work. So I pray for help from here.

Down and dirty info:
Using Oracle 9.2.0.8.0 ojdbc14.jar
Hibernate3 implementing pojo's with annotations
Tomcat 6.0.16
Oracle 10.2.x drivers
C3P0 connction pool provider

In my persistence.xml I have:
Code:
<persistence-unit name="DWEB" transaction-type="RESOURCE_LOCAL">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <properties>
                <property name="hibernate.archive.autodetection" value="class"/>
                <property name="hibernate.connection.password" value="###" />
                <property name="hibernate.connection.username" value="###" />
                <property name="hibernate.default_schema" value="schema" />
                <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
                <property name="hibernate.c3p0.min_size" value="5" />
                <property name="hibernate.c3p0.max_size" value="20" />
                <property name="hibernate.c3p0.timeout" value="300" />
                <property name="hibernate.c3p0.max_statements" value="50" />
                <property name="hibernate.c3p0.idle_test_period" value="3000" />
                <property name="show_sql" value="true" />
                <property name="format_sql" value="true" />
                <property name="use_sql_comments" value="true" />
                <property name="SetBigStringTryClob" value="true"/>
                <property name="hibernate.jdbc.batch_size" value="0"/>
                <property name="hibernate.connection.url" value="jdbc:oracle:thin:@server.ss.com:1521:DDD"/>
                <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/>
        </properties>
</persistence-unit>


The getter and setter looks like:
Code:
@Lob
@Column(name="COMMENT_DOC")
public String getDocument(){
        return get("Document");
}
public void setDocument(String s){
        put("Document",s);
}


The exception I am getting is:
Code:
java.sql.SQLException: No more data to read from socket
   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
   at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1160)
   at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java:963)
   at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java:893)
   at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:375)
   at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
   at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
   at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2152)
...


If I need to give more info pleas ask. Everything works until the dreaded limit is exceeded.


Top
 Profile  
 
 Post subject: Re: Hibernate > CLOB > Oracle :(
PostPosted: Fri Dec 04, 2009 6:20 pm 
Newbie

Joined: Fri Dec 04, 2009 3:38 pm
Posts: 2
After stepping through the code the exception is thrown when the commit is called. The first exception thrown is:
Code:
SQL Error: 17002, SQLState: null
Io exception: Software caused connection abort: socket write error
Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: could not insert: [org.sw.persist.content.Comment]
   at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
   at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
   at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2295)
   at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2688)
   at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
   at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
...


I've tried both 9i and 10g drivers.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.