Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.0.5
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"
>
<hibernate-mapping package="com.lucent.ic.framework.data" >
<class name="Mo" table="MO" dynamic-update="true" >
<id
column="MOOID"
name="moOid"
type="java.lang.Long"
length="12"
>
<generator class="sequence"><param name="sequence">MoOid</param></generator>
</id>
<discriminator column="moType" type="string" length="23" insert="false" />
<natural-id>
<property
column="moName"
length="200"
name="moName"
not-null="true"
type="string"
/>
</natural-id>
<timestamp
name="lastUpdate"
column="lastUpdate"
/>
<property
column="deletionInd"
optimistic-lock="false"
length="1"
name="deletionInd"
not-null="false"
type="boolean"
/>
<property
column="lockedInd"
length="1"
name="lockedInd"
not-null="false"
type="boolean"
/>
<!-- The rest is omitted -->
</class>
</hibernate-mapping>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.lucent.ic.framework.data.mot">
<subclass name="MotAP_DS1" extends="com.lucent.ic.framework.data.Mo"
discriminator-value="AP_DS1" dynamic-update="true" batch-size="500">
<join table="MOT_AP_DS1" fetch="select">
<key column="moOid"/>
<!-- the rest is omitted -->
</join>
</subclass>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
3601447 2005-08-24 23:05:53,142: [pool-1-thread-2] DEBUG org.hibernate.util.JDBCExceptionReporter:63 - could not update: [com.lucent.ic.framework.data.mot.MotAP_DS1#24951]; Object: { [ Mo: com.lucent.ic.framework.data.mot.MotAP_DS1@dba04f33: MoOid: 24951; MoType: AP_DS1; MoName: /System:SysId=10/ECP:ECPId=1/AP:APId=11/AP_DS1:DS1Id=1]; ; Mot attributes: {DS1Id=1, protocol=LAPD, link_spd=null, APId=11, boardtype=INTER, custom1=null, custom4=null, status=e, custom3=null, custom5=null, custom2=null, framing_mode=esf, ECPId=1, rsvd1_tdma=null, SysId=10, line_coding=b8zs, line_rate=t1} } [/* update com.lucent.ic.framework.data.mot.MotAP_DS1 */ update MO set deletionInd=? where MOOID=?]
java.sql.SQLException: Invalid column index
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
at oracle.jdbc.driver.OraclePreparedStatement.setTimestampInternal(OraclePreparedStatement.java:6272)
at oracle.jdbc.driver.OraclePreparedStatement.setTimestamp(OraclePreparedStatement.java:6247)
at org.hibernate.type.TimestampType.set(TimestampType.java:43)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:62)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:44)
at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:1993)
at org.hibernate.persister.entity.BasicEntityPersister.updateOrInsert(BasicEntityPersister.java:1935)
at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:2189)
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:75)
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:137)
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:730)
at com.lucent.ic.framework.data.base._BaseRootDAO.flushAndClearSession(_BaseRootDAO.java:719)
at com.lucent.ic.framework.data.dao.MotDAOImpl.flushAndClearSession(MotDAOImpl.java:316)
at com.lucent.ic.framework.data.base._BaseRootDAO.flushAndClerSession(_BaseRootDAO.java:708)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:288)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:163)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
at $Proxy9.flushAndClerSession(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:288)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:57)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
at $Proxy10.flushAndClerSession(Unknown Source)
at com.lucent.ic.framework.adapters.manager.GenericDataAdapter.processFile(GenericDataAdapter.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:288)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:57)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
at $Proxy24.processFile(Unknown Source)
at com.lucent.ic.framework.adapters.manager.GenericAdapter$DaExecutor.call(GenericAdapter.java:291)
at com.lucent.ic.framework.adapters.manager.GenericAdapter$DaExecutor.call(GenericAdapter.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
3601494 2005-08-24 23:05:53,189: [pool-1-thread-2] WARN org.hibernate.util.JDBCExceptionReporter:71 - SQL Error: 17003, SQLState: null
3601494 2005-08-24 23:05:53,189: [pool-1-thread-2] ERROR org.hibernate.util.JDBCExceptionReporter:72 - Invalid column index
3601603 2005-08-24 23:05:53,298: [pool-1-thread-2] ERROR org.hibernate.persister.entity.BasicEntityPersister:2036 - Failed to update:
org.hibernate.exception.GenericJDBCException: could not update: [com.lucent.ic.framework.data.mot.MotAP_DS1#24951]; Object: { [ Mo: com.lucent.ic.framework.data.mot.MotAP_DS1@dba04f33: MoOid: 24951; MoType: AP_DS1; MoName: /System:SysId=10/ECP:ECPId=1/AP:APId=11/AP_DS1:DS1Id=1]; ; Mot attributes: {DS1Id=1, protocol=LAPD, link_spd=null, APId=11, boardtype=INTER, custom1=null, custom4=null, status=e, custom3=null, custom5=null, custom2=null, framing_mode=esf, ECPId=1, rsvd1_tdma=null, SysId=10, line_coding=b8zs, line_rate=t1} }
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.update(BasicEntityPersister.java:2026)
at org.hibernate.persister.entity.BasicEntityPersister.updateOrInsert(BasicEntityPersister.java:1935)
at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:2189)
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:75)
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:137)
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:730)
at com.lucent.ic.framework.data.base._BaseRootDAO.flushAndClearSession(_BaseRootDAO.java:719)
at com.lucent.ic.framework.data.dao.MotDAOImpl.flushAndClearSession(MotDAOImpl.java:316)
at com.lucent.ic.framework.data.base._BaseRootDAO.flushAndClerSession(_BaseRootDAO.java:708)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:288)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:163)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
at $Proxy9.flushAndClerSession(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:288)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:57)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
at $Proxy10.flushAndClerSession(Unknown Source)
at com.lucent.ic.framework.adapters.manager.GenericDataAdapter.processFile(GenericDataAdapter.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:288)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:57)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
at $Proxy24.processFile(Unknown Source)
at com.lucent.ic.framework.adapters.manager.GenericAdapter$DaExecutor.call(GenericAdapter.java:291)
at com.lucent.ic.framework.adapters.manager.GenericAdapter$DaExecutor.call(GenericAdapter.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: Invalid column index
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
at oracle.jdbc.driver.OraclePreparedStatement.setTimestampInternal(OraclePreparedStatement.java:6272)
at oracle.jdbc.driver.OraclePreparedStatement.setTimestamp(OraclePreparedStatement.java:6247)
at org.hibernate.type.TimestampType.set(TimestampType.java:43)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:62)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:44)
at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:1993)
... 53 more
Name and version of the database you are using:
Oracle 9.2
The generated SQL (show_sql=true):
update MO set deletionInd=? where MOOID=?
Debug level Hibernate log excerpt:
Neither of the variables referenced in the generated SQL statement has type TIMESTAMP, however Hibernate is calling OraclePreparedStatement.setTimestamp ()
Thanks in advance,
Dmitri