-->
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: MSSQL error with long string
PostPosted: Tue May 09, 2006 9:16 am 
Newbie

Joined: Tue May 25, 2004 9:56 am
Posts: 19
When I persist an object that has a very long string (e.g. 5500 chars), I get this exception. It works fine with shorter strings (e.g. 3500 chars), and the table column is varchar(8000)

Hibernate version:
hibernate-3.2.0.CR1, hibernate-annotations-3.1beta9

Mapping documents:
Code:
@Entity
@PrimaryKeyJoinColumn(name = "eform_id")
public class Request extends EForm {
   ...
   protected String additionalDetails;
   ...
}


Full stack trace of any exception that occurs:
Code:
Caused by: java.sql.SQLException: Disallowed implicit conversion from data type ntext to data type varchar, table 'portletsDevDave.uportal_dev_dave_app.tblCAMP_eventreservation_Request', column 'additionalDetails'. Use the CONVERT function to run this query.
   at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
   at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
   at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
   at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:628)
   at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:525)
   at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:487)
   at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:421)
   at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
   at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2123)
   at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2483)
   at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:47)
   at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
   at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290)
   at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:180)
   at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:108)
   at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
   at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
   at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:98)
   at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
   at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:506)
   at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:498)
   at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:494)


Name and version of the database you are using:
MSSQL 8

The generated SQL (show_sql=true):
Hibernate: insert into tblCAMP_eventreservation_Request (Responsible, eventName, estAttendance, Building, rooms, eventDate, startTime, endTime, repeatDates, altEventDate, roomStartTime, roomEndTime, avAssistance, comments, addToCal, additionalDetails, Eform_id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 09, 2006 11:13 am 
Regular
Regular

Joined: Wed Aug 25, 2004 6:23 am
Posts: 91
I think that you're hitting this problem:-

http://sourceforge.net/tracker/index.ph ... tid=407762

see the solutions recommended in the thread (read it from the bottom upwards to make sense!)

Hope that helps.

Cheers,
Rich.


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.