Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Hibernate 3.0 with Springframework
Mapping documents:
<hibernate-mapping>
<class name="SandBox" table="SANDBOX">
<id name="id" column="SANDBOX_ID">
<generator class="native"/>
</id>
<property name="name" type="string" column="NAME" unique-key="sandBoxID"/>
<property name="scmPlugin" type="string" column="SCM_PLUGIN" />
<property name="retrievalPlugin" type="string" column="RETRIEVAL_PLUGIN" />
<many-to-one name="application" column="APPLICATION_ID " class="com.aol.rae.common.application" unique="true" lazy="false" unique-key="sandBoxID"/>
<many-to-one name="user" column="USER_ID" class="com.aol.rae.common.hubUser" unique="true" lazy="false" unique-key="sandBoxID"/>
<property name="loadPath" type="string" column="LOAD_PATH"/>
<property name="scmConfig" type="text" column="SCM_CONFIG" not-null="false" insert="false" />
<set name="resources" table="SANDBOX_RESOURCES" cascade="all-delete-orphan" inverse="true">
<key column="SANDBOX_ID"/>
<one-to-many class="Resource"/>
</set>
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:
2006-09-06 16:55:53,080 [http-8082-Processor25] ERROR org.springframework.orm.hibernate3.HibernateTransactionManager - Commit exception overridden by rollback exception
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not update: [com.aol.rae.common.SandBox#2]; uncategorized SQLException for SQL [update SANDBOX set NAME=?, SCM_PLUGIN=?, RETRIEVAL_PLUGIN=?, APPLICATION_ID =?, USER_ID=?, LOAD_PATH=?, SCM_CONFIG=? where SANDBOX_ID=?]; SQL state [JZ006]; error code [0]; JZ006: Caught IOException: java.io.IOException: JZ0SL: Unsupported SQL type 2005.; nested exception is java.sql.SQLException: JZ006: Caught IOException: java.io.IOException: JZ0SL: Unsupported SQL type 2005.
java.sql.SQLException: JZ006: Caught IOException: java.io.IOException: JZ0SL: Unsupported SQL type 2005.
at com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(ErrorMessage.java:536)
at com.sybase.jdbc2.jdbc.ErrorMessage.raiseErrorCheckDead(ErrorMessage.java:840)
at com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:3491)
at com.sybase.jdbc2.tds.Tds.language(Tds.java:728)
at com.sybase.jdbc2.jdbc.SybStatement.sendQuery(SybStatement.java:1507)
at com.sybase.jdbc2.jdbc.SybPreparedStatement.sendQuery(SybPreparedStatement.java:1206)
at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate(SybStatement.java:1681)
at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeUpdate(SybPreparedStatement.java:104)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:1982)
at org.hibernate.persister.entity.BasicEntityPersister.updateOrInsert(BasicEntityPersister.java:1909)
at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:2149)
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 org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:324)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:584)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:500)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:473)
at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:267)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
Name and version of the database you are using:
The generated SQL (show_sql=true):
Sybase 12.5
Hi All,
I'm getting the above error when I try to persist updates to my class Sandbox. The problem appears to be with the column SCM_CONFIG which is a sybase text column declared to be nullable ., If I don't set this property on the object I get the above error on updates (inserts are fine cos of insert="false" ) and it works just fine if the property is set to some not null value. Has anyone seen this before and is there a work around other than supplying a default value for the field which I don't really want to do ?
Also anybody got any ideas why hibernate attempts updates on fields that haven't changed ?
thanks in advance