-->
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: Error converting the string 'N' to boolean
PostPosted: Tue Jan 17, 2006 11:53 am 
Regular
Regular

Joined: Sat Nov 19, 2005 2:46 pm
Posts: 69
Hibernate version: 3.1

We were going along using MySQL 5.0, and all was dandy. We've been required to move to MS SQL Server, and it seems it can't handle hibernate convenience of:
Code:
<property name="hibernate.query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>


Is this known about? Any clues?

Code:
ERROR:org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704) Servlet.service() for servlet jsp threw exception
org.hibernate.exception.GenericJDBCException: could not initialize a collection: [com.regul8.objects.template.stage.StageTemplate.elementTemplates#801]
   at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
   at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
   at org.hibernate.loader.Loader.loadCollection(Loader.java:1926)
   at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:71)
   at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:520)
   at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
   at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1627)
   at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:454)
   at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:827)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:229)
   at org.hibernate.loader.Loader.loadEntity(Loader.java:1785)
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error converting the string 'N' to boolean.
Code:
   at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
   at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
   at com.microsoft.jdbc.base.BaseData.getBoolean(Unknown Source)
   at com.microsoft.jdbc.base.BaseResultSet.getBoolean(Unknown Source)
   at com.microsoft.jdbc.base.BaseResultSet.getBoolean(Unknown Source)

_________________
Stewart
London, UK


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 2:22 pm 
Regular
Regular

Joined: Sat Nov 19, 2005 2:46 pm
Posts: 69
I solved this by swapping all columns which were CHAR(1) under MySQL to be a BIT type in MS SQL Server

_________________
Stewart
London, UK


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.