Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: error saving string fields larger than 2000 chars
PostPosted: Thu Mar 01, 2007 5:59 pm 
Newbie

Joined: Wed Apr 19, 2006 4:25 pm
Posts: 7
I am using Hibernate 3 with a SQLServer DB. I have a web app that I use to display/edit data. One of the tables that I'm updating has a varchar(8000) column and two int columns. I can retrieve rows where the size of this column is 3000+ characters (inserted using a different tool) and I can display them just fine on the web site. However, whenever I attempt to update this column via hibernate, hibernate goes out to lunch. 2000 characters saves fine, 2001 dies. The config file for this table defines the column as 8000 characters. Any ideas? Here is the error:

15:52:01,711 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: HY000
15:52:01,711 ERROR [JDBCExceptionReporter] [Microsoft][SQLServer JDBC Driver]The DBMS returned an unspecified error.
15:52:01,711 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: could not update: [net.teamsms.gwac.hibernate.ServiceOffering#10934]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:82)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:70)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:2000)
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 net.teamsms.gwac.DatabaseManager.saveOrUpdate(DatabaseManager.java:45)
at net.teamsms.gwac.struts.action.MaintainServiceOfferingDetailAction.save(MaintainServiceOfferingDetailAction.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
at org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:160)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]The DBMS returned an unspecified error.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeInternal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.execute(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:1982)
... 44 more


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 01, 2007 9:39 pm 
Newbie

Joined: Thu Mar 01, 2007 6:58 pm
Posts: 9
Can you check the sql server log file and see if there is more information to provide?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 02, 2007 9:34 am 
Newbie

Joined: Wed Apr 19, 2006 4:25 pm
Posts: 7
The error is:

Error: 17805, Severity: 20, State: 3
Invalid buffer received from client


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 02, 2007 3:03 pm 
Regular
Regular

Joined: Thu Jul 29, 2004 11:55 pm
Posts: 75
quoting "The message itself indicates that a client that connects to SQL Server has sent data to SQL Server that violates the TDS protocol, the protocol that SQL Server and its clients talk to each other. Thus, this indicates that you have a buggy client somewhere. Since application code normally never generates TDS itself, the culprit is more like to be a library
component of some sort.

This might be a problem with your SQL server driver. Can you try a different/3rd party mssql driver and see if that fixes your problem?

Also, are you passing this as parameters to a stored procedure? If sao, there could be another issue.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 02, 2007 3:11 pm 
Newbie

Joined: Wed Apr 19, 2006 4:25 pm
Posts: 7
I have corrected the problem. It turned out to be the JDBC driver that I was using. Downloading the correct driver from microsoft fixed everything. Thanks for the help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 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.