In the Migration Guide (
http://www.hibernate.org/250.html), "Blob and Clob support"
I read
Code:
clob = (oracle.sql.CLOB) ( (org.hibernate.lob.SerializableClob) foo.getText() ).getWrappedClob();
but
where is the SerializableClob class?I can't find it.
By now i'm using org.hibernate.lob.BlobImpl and I get the following errors
thanks in advance for the help
bye
PS actually I need to read/write BLOB to oracle (not CLOB)
Name and version of the database you are using:Oracle 9i, jdbc thin 9.2.0.5, jre 1.3.1
Hibernate version: 3.0rc1
Name and version of the database you are using: Oracle 9i, jdbc thin driver 9.2.0.5, jre 1.3.1
Full stack trace of any exception that occurs:Code:
DEBUG [HttpRequestHandler-3213130] (QueryTranslatorImpl.java:226) - --- SQL AST ---
\-[SELECT] QueryNode: 'SELECT' querySpaces (ds_documents)
+-[SELECT_CLAUSE] SelectClause: '{derived select clause}'
| +-[SELECT_EXPR] SelectExpressionImpl: 'ds_documen0_.id as id' {FromElement{explicit,not a collection join,classAlias=d,role=null,tableName=ds_documents,tableAlias=ds_documen0_,colums={,className=org.DocumentStore.dati.DS_Documents}}}
| \-[SQL_TOKEN] SqlFragment: 'ds_documen0_.name as name0_, ds_documen0_.description as descript3_0_, ds_documen0_.creation_date as creation4_0_, ds_documen0_.f_lock as f5_0_, ds_documen0_.mime_type as mime6_0_, ds_documen0_.owner as owner0_, ds_documen0_.parent as parent0_, ds_documen0_.language as language0_, ds_documen0_.f_type as f10_0_, ds_documen0_.revision as revision0_, ds_documen0_.f_public as f12_0_, ds_documen0_.category as category0_, ds_documen0_.f_size as f14_0_, ds_documen0_.hash_code as hash15_0_, ds_documen0_.image as image0_, ds_documen0_.thumb as thumb0_'
+-[FROM] FromClause: 'from' FromClause{from}
| \-[FROM_FRAGMENT] FromElement: 'ds_documents ds_documen0_' FromElement{explicit,not a collection join,classAlias=d,role=null,tableName=ds_documents,tableAlias=ds_documen0_,colums={,className=org.DocumentStore.dati.DS_Documents}}
\-[WHERE] SqlNode: 'where'
\-[AND] SqlNode: 'and'
+-[AND] SqlNode: 'and'
| +-[EQ] SqlNode: '='
| | +-[DOT] DotNode: 'ds_documen0_.parent' {propertyName=parent,dereferenceType=4,propertyPath=parent,path=d.parent,tableAlias=ds_documen0_,className=org.DocumentStore.dati.DS_Documents,classAlias=d}
| | | +-[ALIAS_REF] IdentNode: 'ds_documen0_.id' {alias=d, className=org.DocumentStore.dati.DS_Documents, tableAlias=ds_documen0_}
| | | \-[IDENT] IdentNode: 'parent' {originalText=parent}
| | \-[NUM_INT] LiteralNode: '0'
| \-[EQ] SqlNode: '='
| +-[DOT] DotNode: 'ds_documen0_.f_type' {propertyName=f_type,dereferenceType=4,propertyPath=f_type,path=d.f_type,tableAlias=ds_documen0_,className=org.DocumentStore.dati.DS_Documents,classAlias=d}
| | +-[ALIAS_REF] IdentNode: 'ds_documen0_.id' {alias=d, className=org.DocumentStore.dati.DS_Documents, tableAlias=ds_documen0_}
| | \-[IDENT] IdentNode: 'f_type' {originalText=f_type}
| \-[NUM_INT] LiteralNode: '1'
\-[EQ] SqlNode: '='
+-[DOT] DotNode: 'ds_documen0_.category' {propertyName=category,dereferenceType=4,propertyPath=category,path=d.category,tableAlias=ds_documen0_,className=org.DocumentStore.dati.DS_Documents,classAlias=d}
| +-[ALIAS_REF] IdentNode: 'ds_documen0_.id' {alias=d, className=org.DocumentStore.dati.DS_Documents, tableAlias=ds_documen0_}
| \-[IDENT] IdentNode: 'category' {originalText=category}
\-[NUM_INT] LiteralNode: '0'
DEBUG [HttpRequestHandler-3213130] (ErrorCounter.java:83) - throwQueryException() : no errors
DEBUG [HttpRequestHandler-3213130] (QueryTranslatorImpl.java:177) - HQL: from org.DocumentStore.dati.DS_Documents d where d.parent = 0 and d.f_type=1 and d.category=0
DEBUG [HttpRequestHandler-3213130] (QueryTranslatorImpl.java:178) - SQL: select ds_documen0_.id as id, ds_documen0_.name as name0_, ds_documen0_.description as descript3_0_, ds_documen0_.creation_date as creation4_0_, ds_documen0_.f_lock as f5_0_, ds_documen0_.mime_type as mime6_0_, ds_documen0_.owner as owner0_, ds_documen0_.parent as parent0_, ds_documen0_.language as language0_, ds_documen0_.f_type as f10_0_, ds_documen0_.revision as revision0_, ds_documen0_.f_public as f12_0_, ds_documen0_.category as category0_, ds_documen0_.f_size as f14_0_, ds_documen0_.hash_code as hash15_0_, ds_documen0_.image as image0_, ds_documen0_.thumb as thumb0_ from ds_documents ds_documen0_ where (ds_documen0_.parent=0 and ds_documen0_.f_type=1 and ds_documen0_.category=0)
DEBUG [HttpRequestHandler-3213130] (ErrorCounter.java:83) - throwQueryException() : no errors
DEBUG [HttpRequestHandler-3213130] (AbstractBatcher.java:258) - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
DEBUG [HttpRequestHandler-3213130] (AbstractBatcher.java:292) - select ds_documen0_.id as id, ds_documen0_.name as name0_, ds_documen0_.description as descript3_0_, ds_documen0_.creation_date as creation4_0_, ds_documen0_.f_lock as f5_0_, ds_documen0_.mime_type as mime6_0_, ds_documen0_.owner as owner0_, ds_documen0_.parent as parent0_, ds_documen0_.language as language0_, ds_documen0_.f_type as f10_0_, ds_documen0_.revision as revision0_, ds_documen0_.f_public as f12_0_, ds_documen0_.category as category0_, ds_documen0_.f_size as f14_0_, ds_documen0_.hash_code as hash15_0_, ds_documen0_.image as image0_, ds_documen0_.thumb as thumb0_ from ds_documents ds_documen0_ where (ds_documen0_.parent=0 and ds_documen0_.f_type=1 and ds_documen0_.category=0)
DEBUG [HttpRequestHandler-3213130] (AbstractBatcher.java:343) - preparing statement
DEBUG [HttpRequestHandler-3213130] (AbstractBatcher.java:274) - about to open ResultSet (open ResultSets: 0, globally: 0)
DEBUG [HttpRequestHandler-3213130] (Loader.java:377) - processing result set
DEBUG [HttpRequestHandler-3213130] (Loader.java:399) - done processing result set (0 rows)
DEBUG [HttpRequestHandler-3213130] (AbstractBatcher.java:281) - about to close ResultSet (open ResultSets: 1, globally: 1)
DEBUG [HttpRequestHandler-3213130] (AbstractBatcher.java:266) - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG [HttpRequestHandler-3213130] (AbstractBatcher.java:363) - closing statement
DEBUG [HttpRequestHandler-3213130] (Loader.java:450) - total objects hydrated: 0
DEBUG [HttpRequestHandler-3213130] (PersistenceContext.java:738) - initializing non-lazy collections
DEBUG [HttpRequestHandler-3213130] (DefaultSaveOrUpdateEventListener.java:159) - saving transient instance
DEBUG [HttpRequestHandler-3213130] (AbstractBatcher.java:258) - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
DEBUG [HttpRequestHandler-3213130] (AbstractBatcher.java:292) - select hibernate_sequence.nextval from dual
DEBUG [HttpRequestHandler-3213130] (AbstractBatcher.java:343) - preparing statement
DEBUG [HttpRequestHandler-3213130] (SequenceGenerator.java:87) - Sequence identifier generated: 5
DEBUG [HttpRequestHandler-3213130] (AbstractBatcher.java:266) - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG [HttpRequestHandler-3213130] (AbstractBatcher.java:363) - closing statement
DEBUG [HttpRequestHandler-3213130] (AbstractSaveEventListener.java:89) - generated identifier: 5, using strategy: org.hibernate.id.SequenceGenerator
DEBUG [HttpRequestHandler-3213130] (AbstractSaveEventListener.java:132) - saving [org.DocumentStore.dati.DS_Documents#5]
DEBUG [HttpRequestHandler-3213130] (JDBCTransaction.java:83) - commit
DEBUG [HttpRequestHandler-3213130] (SessionImpl.java:292) - automatically flushing session
DEBUG [HttpRequestHandler-3213130] (AbstractFlushingEventListener.java:52) - flushing session
DEBUG [HttpRequestHandler-3213130] (AbstractFlushingEventListener.java:102) - processing flush-time cascades
DEBUG [HttpRequestHandler-3213130] (AbstractFlushingEventListener.java:150) - dirty checking collections
DEBUG [HttpRequestHandler-3213130] (AbstractFlushingEventListener.java:167) - Flushing entities and processing referenced collections
DEBUG [HttpRequestHandler-3213130] (AbstractFlushingEventListener.java:203) - Processing unreferenced collections
DEBUG [HttpRequestHandler-3213130] (AbstractFlushingEventListener.java:217) - Scheduling collection removes/(re)creates/updates
DEBUG [HttpRequestHandler-3213130] (AbstractFlushingEventListener.java:79) - Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects
DEBUG [HttpRequestHandler-3213130] (AbstractFlushingEventListener.java:85) - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
DEBUG [HttpRequestHandler-3213130] (Printer.java:83) - listing entities:
DEBUG [HttpRequestHandler-3213130] (Printer.java:90) - org.DocumentStore.dati.DS_Documents{thumb=null, f_size=14653, name=cervello.jpg, category=0, id=5, owner=dsctrl_autom, image=org.hibernate.lob.BlobImpl@5f44fb, creation_date=2005-03-24 16:54:37, language=, f_public=1, revision=, f_type=0, mime_type=image/jpeg, hash_code=null, parent=0, description=, f_lock=0}
DEBUG [HttpRequestHandler-3213130] (AbstractFlushingEventListener.java:267) - executing flush
DEBUG [HttpRequestHandler-3213130] (BasicEntityPersister.java:1795) - Inserting entity: [org.DocumentStore.dati.DS_Documents#5]
DEBUG [HttpRequestHandler-3213130] (AbstractBatcher.java:258) - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
DEBUG [HttpRequestHandler-3213130] (AbstractBatcher.java:292) - insert into ds_documents (name, description, creation_date, f_lock, mime_type, owner, parent, language, f_type, revision, f_public, category, f_size, hash_code, image, thumb, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
DEBUG [HttpRequestHandler-3213130] (AbstractBatcher.java:343) - preparing statement
DEBUG [HttpRequestHandler-3213130] (BasicEntityPersister.java:1587) - Dehydrating entity: [org.DocumentStore.dati.DS_Documents#5]
DEBUG [HttpRequestHandler-3213130] (NullableType.java:59) - binding 'cervello.jpg' to parameter: 1
DEBUG [HttpRequestHandler-3213130] (NullableType.java:59) - binding '' to parameter: 2
DEBUG [HttpRequestHandler-3213130] (NullableType.java:59) - binding '2005-03-24 16:54:37' to parameter: 3
DEBUG [HttpRequestHandler-3213130] (NullableType.java:59) - binding '0' to parameter: 4
DEBUG [HttpRequestHandler-3213130] (NullableType.java:59) - binding 'image/jpeg' to parameter: 5
DEBUG [HttpRequestHandler-3213130] (NullableType.java:59) - binding 'dsctrl_autom' to parameter: 6
DEBUG [HttpRequestHandler-3213130] (NullableType.java:59) - binding '0' to parameter: 7
DEBUG [HttpRequestHandler-3213130] (NullableType.java:59) - binding '' to parameter: 8
DEBUG [HttpRequestHandler-3213130] (NullableType.java:59) - binding '0' to parameter: 9
DEBUG [HttpRequestHandler-3213130] (NullableType.java:59) - binding '' to parameter: 10
DEBUG [HttpRequestHandler-3213130] (NullableType.java:59) - binding '1' to parameter: 11
DEBUG [HttpRequestHandler-3213130] (NullableType.java:59) - binding '0' to parameter: 12
DEBUG [HttpRequestHandler-3213130] (NullableType.java:59) - binding '14653' to parameter: 13
DEBUG [HttpRequestHandler-3213130] (NullableType.java:52) - binding null to parameter: 14
DEBUG [HttpRequestHandler-3213130] (NullableType.java:59) - binding '5' to parameter: 17
DEBUG [HttpRequestHandler-3213130] (BatchingBatcher.java:27) - Adding to batch
DEBUG [HttpRequestHandler-3213130] (AbstractBatcher.java:266) - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG [HttpRequestHandler-3213130] (AbstractBatcher.java:363) - closing statement
DEBUG [HttpRequestHandler-3213130] (JDBCExceptionReporter.java:49) - could not insert: [org.DocumentStore.dati.DS_Documents] [insert into ds_documents (name, description, creation_date, f_lock, mime_type, owner, parent, language, f_type, revision, f_public, category, f_size, hash_code, image, thumb, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]
java.sql.SQLException: operazione non consentita: streams type cannot be used in batching
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.driver.OraclePreparedStatement.addBatch(OraclePreparedStatement.java:3775)
at com.evermind.sql.FilterPreparedStatement.addBatch(FilterPreparedStatement.java:29)
at com.evermind.sql.FilterPreparedStatement.addBatch(FilterPreparedStatement.java:29)
at com.evermind.sql.FilterPreparedStatement.addBatch(FilterPreparedStatement.java:29)
at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:29)
at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1823)
at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2171)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:46)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:136)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:669)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:293)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
at org.DocumentStore.DAO.MySQLDAOFactory.commit(MySQLDAOFactory.java:76)
at org.DocumentStore.action.ds_put.perform(ds_put.java:259)
at org.DocumentStore.DSController.doPost(DSController.java:127)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at mkcc.utility.servlet.filter.FilterGarbageValueListHandler.doFilter(FilterGarbageValueListHandler.java:52)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at mkcc.utility.servlet.filter.FilterControlloAccesso.doFilter(FilterControlloAccesso.java:92)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:484)
WARN [HttpRequestHandler-3213130] (JDBCExceptionReporter.java:57) - SQL Error: 17090, SQLState: null
ERROR [HttpRequestHandler-3213130] (JDBCExceptionReporter.java:58) - operazione non consentita: streams type cannot be used in batching
ERROR [HttpRequestHandler-3213130] (AbstractFlushingEventListener.java:277) - Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: could not insert: [org.DocumentStore.dati.DS_Documents]
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1839)
at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2171)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:46)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:136)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:669)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:293)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
at org.DocumentStore.DAO.MySQLDAOFactory.commit(MySQLDAOFactory.java:76)
at org.DocumentStore.action.ds_put.perform(ds_put.java:259)
at org.DocumentStore.DSController.doPost(DSController.java:127)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at mkcc.utility.servlet.filter.FilterGarbageValueListHandler.doFilter(FilterGarbageValueListHandler.java:52)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at mkcc.utility.servlet.filter.FilterControlloAccesso.doFilter(FilterControlloAccesso.java:92)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:484)
Caused by:
java.sql.SQLException: operazione non consentita: streams type cannot be used in batching
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.driver.OraclePreparedStatement.addBatch(OraclePreparedStatement.java:3775)
at com.evermind.sql.FilterPreparedStatement.addBatch(FilterPreparedStatement.java:29)
at com.evermind.sql.FilterPreparedStatement.addBatch(FilterPreparedStatement.java:29)
at com.evermind.sql.FilterPreparedStatement.addBatch(FilterPreparedStatement.java:29)
at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:29)
at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1823)
... 26 more
Commit error : org.hibernate.exception.GenericJDBCException: could not insert: [org.DocumentStore.dati.DS_Documents]
DEBUG [HttpRequestHandler-3213130] (SessionImpl.java:246) - closing session
DEBUG [HttpRequestHandler-3213130] (AbstractBatcher.java:394) - closing JDBC connection (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)
[/url]