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.  [ 2 posts ] 
Author Message
 Post subject: Exception thrown when set null to a column type="text&q
PostPosted: Fri Jan 21, 2005 1:31 am 
Beginner
Beginner

Joined: Wed Sep 15, 2004 3:14 am
Posts: 35
Hibernate version: 2.1.7c

Mapping documents:
Code:
        <property
            name="body"
            type="text"
            update="true"
            insert="true"
            access="property"
            column="body"
        />


Full stack trace of any exception that occurs:

Code:
org.springframework.jdbc.BadSqlGrammarException: Bad SQL grammar [] in task 'HibernateTemplate'; nested exception is org.postgresql.util.PSQLException: Unknown Types value.
org.postgresql.util.PSQLException: Unknown Types value.
   at org.postgresql.jdbc2.AbstractJdbc2Statement.setNull(AbstractJdbc2Statement.java:988)
   at org.postgresql.jdbc3.AbstractJdbc3Statement.setNull(AbstractJdbc3Statement.java:1435)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.setNull(DelegatingPreparedStatement.java:104)
   at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:43)
   at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:35)
   at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:389)
   at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:462)
   at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:438)
   at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:37)
   at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2438)
   at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2391)
   at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2260)
   at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
   at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:460)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:373)
   at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:241)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:66)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:152)


Name and version of the database you are using: PostgreSQL 8.0

When I set the body column to null, I get the exception above. Is this how it's supposed to happen?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 21, 2005 1:32 am 
Beginner
Beginner

Joined: Wed Sep 15, 2004 3:14 am
Posts: 35
It works fine when I set it with empty String, i.e.
Code:
""


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.