-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Problem binding sybase text column to null
PostPosted: Wed Sep 06, 2006 12:23 pm 
Newbie

Joined: Wed Sep 06, 2006 11:49 am
Posts: 1
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


Top
 Profile  
 
 Post subject: Re: Problem binding sybase text column to null
PostPosted: Mon Oct 19, 2009 2:52 pm 
Newbie

Joined: Fri Oct 02, 2009 2:46 pm
Posts: 2
The workaround is to set the text field to "" which will be inserted as NULL in Sybase.


Top
 Profile  
 
 Post subject: Re: Problem binding sybase text column to null
PostPosted: Mon Nov 30, 2009 7:46 am 
Newbie

Joined: Wed Mar 21, 2007 5:31 pm
Posts: 1
A bug was created on sybase http://case-express.sybase.com/cx/caseS ... r=11573171 but not yet resolved.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.