Hibernate version: 3.0.3
Full stack trace of any exception that occurs:
Code:
com.xxx.deployment.hibernate.exceptions.InfrastructureException: org.hibernate.exception.GenericJDBCException: could not insert: [com.xxx.vo.Class]
at com.xxx.deployment.hibernate.persistence.HibernateUtil.commitTransaction(HibernateUtil.java:194)
at com.xxx.deployment.hibernate.persistence.HibernateFilter.doFilter(HibernateFilter.java:67)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
Caused by: org.hibernate.exception.GenericJDBCException: could not insert: [com.xxx.vo.Class]
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:1859)
at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2190)
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:726)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:320)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
at com.xxx.deployment.hibernate.persistence.HibernateUtil.commitTransaction(HibernateUtil.java:188)
... 25 more
Caused by: java.sql.SQLException: Data size bigger than max size for this type: 57614
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java:95)
at oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:2414)
at oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:1134)
at oracle.jdbc.driver.OraclePreparedStatement.setBytes(OraclePreparedStatement.java:2170)
at org.apache.commons.dbcp.DelegatingPreparedStatement.setBytes(DelegatingPreparedStatement.java:134)
at org.hibernate.type.BinaryType.set(BinaryType.java:29)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:62)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:39)
at org.hibernate.persister.entity.BasicEntityPersister.dehydrate(BasicEntityPersister.java:1607)
at org.hibernate.persister.entity.BasicEntityPersister.dehydrate(BasicEntityPersister.java:1584)
at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1840)
... 36 more
Name and version of the database you are using: Oracle 9.2.0.7
I'm having a problem getting hibernate to read and enforce and environment property. This error I'm getting is a problem with the setBytes() method in the BinaryType class. Since my binary object is more than 4KB, Oracle throws a fit when trying to insert a byte array larger than 4KB--therefore it needs to be using the binary stream.
To do this, I know I need to set the system level property, hibernate.jdbc.use_streams_for_binary. However, I've tried setting this in two places--in the hibernate.cfg.xml file and in the hibernate.properties file. The debug loading the configurations show it is being parsed:
Code:
12:05:07,031 DEBUG Configuration:1117 - connection.datasource=java:comp/env/jdbc/AmisysOracle
12:05:07,046 DEBUG Configuration:1117 - show_sql=true
12:05:07,046 DEBUG Configuration:1117 - dialect=org.hibernate.dialect.OracleDialect
12:05:07,046 DEBUG Configuration:1117 - jdbc.use_streams_for_binary=true
12:05:07,046 DEBUG Configuration:1117 - cache.use_query_cache=true
hibernate.cfg.xml:
Code:
<property name="connection.datasource">java:comp/env/jdbc/@jndi.name@</property>
<property name="show_sql">false</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.cache.use_query_cache">true</property>
<property name="jdbc.use_streams_for_binary">true</property>
I'm looking in the documentation and the forums for information about what the cause of this could be, but I can't find any reasoning behind why my configuration isn't being enforced when the Environment.useStreamsForBinary() statement is executed in the set() method in BinaryType.
Any ideas or assistance as to why this is still comming back as false, enven though I'm setting it as true in one place or two, or in different ways (prefixing with hibernate. and not).