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