-->
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.  [ 4 posts ] 
Author Message
 Post subject: trying to update I get "stream closed" error
PostPosted: Mon Dec 01, 2003 1:38 pm 
Newbie

Joined: Wed Oct 08, 2003 11:27 am
Posts: 18
I have this scenario:

I get a session from session factory and I use reconnect and disconnect, durring my http session. In fact I associate to each use that is logged, and between the user action I call reconnect(before the action) and disconnect(after the action).
I create an Article bean(a) and a Content bean(c).
After I set:
Code:
c.setContent(clob);

Than I set the content to the article:
Code:
a.setContent(c);

And I save the article commit the transaction.
I use cascade="All" for the article relation with content.

Than in another action I'm loading the same article using
Code:
session.load()

and than I get the content from the article like this:
Code:
a.getContent().setCheckOut(longParam);

Now, when I try to update the article I get the following error:
...............
DEBUG net.sf.hibernate.persister.AbstractEntityPersister - de.ems.cms.beans.Content.checkout is dirty
DEBUG net.sf.hibernate.impl.SessionImpl - Updating entity: [de.ems.cms.beans.Content#10000055]
DEBUG net.sf.hibernate.persister.AbstractEntityPersister - de.ems.cms.beans.Article.checkout is dirty
DEBUG net.sf.hibernate.impl.SessionImpl - Updating entity: [de.ems.cms.beans.Article#10000054]
DEBUG net.sf.hibernate.impl.SessionImpl - Processing unreferenced collections
DEBUG net.sf.hibernate.impl.SessionImpl - Scheduling collection removes/(re)creates/updates
DEBUG net.sf.hibernate.impl.SessionImpl - Flushed: 0 insertions, 2 updates, 0 deletions to 19 objects
DEBUG net.sf.hibernate.impl.SessionImpl - Flushed: 0 (re)creations, 0 updates, 0 removals to 164 collections
DEBUG net.sf.hibernate.impl.SessionImpl - executing flush
DEBUG net.sf.hibernate.persister.EntityPersister - Updating entity: de.ems.cms.beans.Content#10000055
DEBUG net.sf.hibernate.impl.BatcherImpl - about to open: 0 open PreparedStatements, 0 open ResultSets
DEBUG net.sf.hibernate.impl.SessionFactoryImpl - prepared statement get: update CONTENT_ set CTYPE=?, CREATION_DATE=?, XML_CONTENT=?, MODIFY_DATE=?, EXPIRE_DATE=?, DELETED=?, CHECKOUT=?, ID_MANDANT=?, ID_CSS=?, ID_DTD=?, ID_USER=?, ID_LANG=? where ID=?
Hibernate: update CONTENT_ set CTYPE=?, CREATION_DATE=?, XML_CONTENT=?, MODIFY_DATE=?, EXPIRE_DATE=?, DELETED=?, CHECKOUT=?, ID_MANDANT=?, ID_CSS=?, ID_DTD=?, ID_USER=?, ID_LANG=? where ID=?
DEBUG net.sf.hibernate.ps.PreparedStatementCache - preparing statement: update CONTENT_ set CTYPE=?, CREATION_DATE=?, XML_CONTENT=?, MODIFY_DATE=?, EXPIRE_DATE=?, DELETED=?, CHECKOUT=?, ID_MANDANT=?, ID_CSS=?, ID_DTD=?, ID_USER=?, ID_LANG=? where ID=?
DEBUG net.sf.hibernate.persister.EntityPersister - Dehydrating entity: de.ems.cms.beans.Content#10000055
DEBUG net.sf.hibernate.type.StringType - binding 'A' to parameter: 1
DEBUG net.sf.hibernate.type.TimestampType - binding '01 December 2003 07:18:16' to parameter: 2
DEBUG net.sf.hibernate.type.ClobType - binding 'net.sf.hibernate.lob.ClobImpl@1bfa8f1' to parameter: 3
DEBUG net.sf.hibernate.util.JDBCExceptionReporter - SQL Exception
java.sql.SQLException: Io exception: Stream closed
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:335)
at oracle.jdbc.driver.OraclePreparedStatement.setCharacterStream(OraclePreparedStatement.java:3020)
at net.sf.hibernate.type.ClobType.set(ClobType.java:18)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:46)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:31)
at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:371)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:635)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:611)
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:31)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2100)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2062)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2005)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:57)
at ro.level7.common.db.directimpl.TransactionImpl.commit(TransactionImpl.java:28)
at de.ems.cms.modules.article.screens.ArticleEdit.doBuildTemplateCms(ArticleEdit.java:82)
at de.ems.cms.modules.main.screens.SecureScreen.doBuildTemplate(SecureScreen.java:71)
at org.apache.turbine.modules.screens.VelocitySecureScreen.doBuildTemplate(VelocitySecureScreen.java:102)
at org.apache.turbine.modules.screens.TemplateScreen.doBuild(TemplateScreen.java:138)
at org.apache.turbine.modules.Screen.build(Screen.java:95)
at org.apache.turbine.modules.ScreenLoader.eval(ScreenLoader.java:142)
at org.apache.turbine.modules.layouts.VelocityOnlyLayout.doBuild(VelocityOnlyLayout.java:130)
at org.apache.turbine.modules.Layout.build(Layout.java:91)
at org.apache.turbine.modules.LayoutLoader.exec(LayoutLoader.java:138)
at org.apache.turbine.modules.pages.DefaultPage.doBuild(DefaultPage.java:187)
at org.apache.turbine.modules.Page.build(Page.java:91)
at org.apache.turbine.modules.PageLoader.exec(PageLoader.java:136)
at org.apache.turbine.Turbine.doGet(Turbine.java:796)
at org.apache.turbine.Turbine.doPost(Turbine.java:891)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
.........

Please help!

Daniel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 01, 2003 7:26 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
You need to figure out exactly which Oracle JDBC driver bug causes this problem, figure out how to work around it using direct JDBC, then you should be able to avoid it in your Hibernate code.

The Oracle JDBC driver has many problems and limitations when it comes to Blobs/Clobs and we really are unable to provide proper support for such broken stuff.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 02, 2003 3:51 am 
Newbie

Joined: Wed Oct 08, 2003 11:27 am
Posts: 18
Ok, but why Hibernate tries to update all the columns in the CONTENT table, when I modified only one column(in this case was CHECKOUT with long type)?

How can I use those error messages, e.g. SQL 17090?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 02, 2003 3:58 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
Ok, but why Hibernate tries to update all the columns in the CONTENT table, when I modified only one column


Because it is usually faster. No need to generate SQL dynamically.

If you don't want this, use dynamic-update="true". This is, of course, mentioned in the user manual.

Quote:
How can I use those error messages, e.g. SQL 17090?


Like I said, we can't support your JDBC driver here! Its simply not fair to ask us to do this. You have paid money to Oracle, make them support their own broken driver!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.