It seems that Hibernate does not accept non-serializable parameters to be passed to stored procedures? Please refer to the stack trace.
I was trying to pass an Oracle Array (:invisibles) to the stored procedure and I got this "Could not serialize" exception.
Any one knows anything about this? I could not find relevent information in the Hibernate documentations.
Really appreciate for any replies.
Thanks,
Hibernate version: 3.2
Mapping documents: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <!-- Generated 28-Jun-2007 3:21:34 PM by Hibernate Tools 3.2.0.b9 --> <hibernate-mapping> <class name="EvaluationImpl" table="EVALUATION" schema="ACE_OWNER"> <id name="idNbr" type="int"> <column name="ID_NBR" precision="9" scale="0" /> <generator class="assigned" /> </id> </class> <sql-query name="CREATE_EVLTN" callable="true"> <return alias="evl" class="EvaluationImpl"> <return-property name="idNbr" column="IDNbr"/> </return> { ? = call BUSINESS_UTIL.CREATE_EVLTN(:driverNum, :routeNum, :mgrNum, :supvrNum, :vehicleId, :vehicleTypeId, :nextReviewDate, :overrideDate, :evltnCrteDesc, :deliveryRouteNum, :pickupRouteNum, :inivisibles, :datecreated) } </sql-query> </hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs: org.hibernate.type.SerializationException: could not serialize at org.hibernate.util.SerializationHelper.serialize(SerializationHelper.java:158) at org.hibernate.util.SerializationHelper.serialize(SerializationHelper.java:178) at org.hibernate.type.SerializableType.toBytes(SerializableType.java:78) at org.hibernate.type.SerializableType.toString(SerializableType.java:62) at org.hibernate.type.NullableType.nullSafeToString(NullableType.java:93) at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:140) at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:116) at org.hibernate.loader.Loader.bindNamedParameters(Loader.java:1753) at org.hibernate.loader.Loader.bindParameterValues(Loader.java:1679) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1563) at org.hibernate.loader.Loader.doQuery(Loader.java:673) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) at org.hibernate.loader.Loader.doList(Loader.java:2220) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) at org.hibernate.loader.Loader.list(Loader.java:2099) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289) at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695) at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142) at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152) at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:811) at com.fedex.ace.dao.EvaluationDaoImpl.createEvaluation(EvaluationDaoImpl.java:203) at com.fedex.ace.service.EvaluationManagerImpl.createEvaluation(EvaluationManagerImpl.java:19) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy1.createEvaluation(Unknown Source) at com.fedex.ace.service.test.EvaluationManagerTest.testCreateEvaluation(EvaluationManagerTest.java:39) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: java.io.NotSerializableException: oracle.jdbc.driver.T4CConnection at java.io.ObjectOutputStream.writeObject0(Unknown Source) at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source) at java.io.ObjectOutputStream.writeSerialData(Unknown Source) at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source) at java.io.ObjectOutputStream.writeObject0(Unknown Source) at java.io.ObjectOutputStream.writeObject(Unknown Source) at org.hibernate.util.SerializationHelper.serialize(SerializationHelper.java:154) ... 51 more
Name and version of the database you are using:Oracle 9
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
|