-->
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: UncategorizedSQLException when fetching data
PostPosted: Wed Jul 22, 2009 9:10 am 
Newbie

Joined: Thu Jun 04, 2009 10:02 am
Posts: 6
Hi all,

When trying to fetch data i encounter a really weird exception. The fetching is done in this following way:

DAO:
Code:
    public Calculation getCalculationByOfferVersion(int offerVersionId) {
        List result = getHibernateTemplate().findByNamedQueryAndNamedParam(
                "getCalculationByOfferVersion",
                new String[]{"offerVersionId"},
                new Object[]{offerVersionId});
        return (result.isEmpty()) ? null : (Calculation) result.get(0);       
    }   

Query:
Code:
    <query name="getCalculationByOfferVersion">
        <![CDATA[
         from Calculation c
         where
         c.offerVersion.offerVersionId = :offerVersionId
       ]]>
    </query>           


When executing query directly thourg Hibernate tools for Eclipse, the query is executed succesfully, and the object retrieved as it should be. But when using service layer/dao in the above way the below described exception is thrown.

Any input is apreciated, since I am pretty stuck by now.

Stacktrace:
Code:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not update: [com.issworld.simiss.domain.Calculation#69]; uncategorized SQLException for SQL [update SimISS.dbo.Calculation set ModifiedDate=?, OfferVersionId=?, DaysPerYearToSubtract=?, HoursPerYearSunday=?, HoursPerYearSaturday=?, HoursPerYearPublicHoliday=?, HoursPerYearNight=?, NumberOfMonths=?, PricePerMonth=?, ContributionCB1APct=?, TotalWages=?, ContributionCB1B=?, DailyAvgCleaningArea=?, TotalCleaningPerformance=?, SaturdaysPerYear=?, SundaysPerYear=?, SickPayPct=?, DepreciationPct=?, MaterialsCostPct=?, SocialCostPct=?, AvgExtraPayPct=?, ManagementPayrate=?, ManagementHours=?, Comment=?, OldPricePerMonth=? where CalculationId=? and ModifiedDate=?]; SQL state [S1000]; error code [8023]; The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 10 (""): The supplied value is not a valid instance of data type float. Check the source data for invalid values. An example of an invalid value is data of numeric type with scale greater than precision.; nested exception is java.sql.SQLException: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 10 (""): The supplied value is not a valid instance of data type float. Check the source data for invalid values. An example of an invalid value is data of numeric type with scale greater than precision.
   org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:488)
   org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
   org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
   org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
   org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:106)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
   org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)

root cause

org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not update: [com.issworld.simiss.domain.Calculation#69]; uncategorized SQLException for SQL [update SimISS.dbo.Calculation set ModifiedDate=?, OfferVersionId=?, DaysPerYearToSubtract=?, HoursPerYearSunday=?, HoursPerYearSaturday=?, HoursPerYearPublicHoliday=?, HoursPerYearNight=?, NumberOfMonths=?, PricePerMonth=?, ContributionCB1APct=?, TotalWages=?, ContributionCB1B=?, DailyAvgCleaningArea=?, TotalCleaningPerformance=?, SaturdaysPerYear=?, SundaysPerYear=?, SickPayPct=?, DepreciationPct=?, MaterialsCostPct=?, SocialCostPct=?, AvgExtraPayPct=?, ManagementPayrate=?, ManagementHours=?, Comment=?, OldPricePerMonth=? where CalculationId=? and ModifiedDate=?]; SQL state [S1000]; error code [8023]; The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 10 (""): The supplied value is not a valid instance of data type float. Check the source data for invalid values. An example of an invalid value is data of numeric type with scale greater than precision.; nested exception is java.sql.SQLException: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 10 (""): The supplied value is not a valid instance of data type float. Check the source data for invalid values. An example of an invalid value is data of numeric type with scale greater than precision.
   org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:120)
   org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:276)
   org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)
   org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410)
   org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:377)
   org.springframework.orm.hibernate3.HibernateTemplate.findByNamedQueryAndNamedParam(HibernateTemplate.java:934)
   com.issworld.simiss.dao.hibernate.HibernateSimISSDao.getCalculationByOfferVersion(HibernateSimISSDao.java:628)
   com.issworld.simiss.service.OfferVersionService.getCalcSheet(OfferVersionService.java:1342)
   com.issworld.simiss.service.OfferVersionService.getVipCalculationsWithBenchmarks(OfferVersionService.java:1763)
   com.issworld.simiss.service.OfferVersionService$$FastClassByCGLIB$$ea35a63c.invoke(<generated>)
   net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
   org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:696)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:631)
   com.issworld.simiss.service.OfferVersionService$$EnhancerByCGLIB$$e8c98d33.getVipCalculationsWithBenchmarks(<generated>)
   com.issworld.simiss.web.controller.vip.VipController.lookUpOfferVersions(VipController.java:153)
   com.issworld.simiss.web.controller.vip.VipController.formBackingObject(VipController.java:108)
   org.springframework.web.servlet.mvc.AbstractFormController.getErrorsForNewForm(AbstractFormController.java:358)
   org.springframework.web.servlet.mvc.AbstractFormController.showNewForm(AbstractFormController.java:338)
   org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:278)
   org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
   org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
   org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:859)
   org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:793)
   org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
   org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
   org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
   org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
   org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:106)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
   org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)

root cause

java.sql.SQLException: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 10 (""): The supplied value is not a valid instance of data type float. Check the source data for invalid values. An example of an invalid value is data of numeric type with scale greater than precision.
   net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
   net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
   net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
   net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:628)
   net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:525)
   net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:487)
   net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:421)
   org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2208)
   org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2118)
   org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2374)
   org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:91)
   org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
   org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
   org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
   org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
   org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:41)
   org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:954)
   org.hibernate.impl.SessionImpl.list(SessionImpl.java:1099)
   org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
   org.springframework.orm.hibernate3.HibernateTemplate$33.doInHibernate(HibernateTemplate.java:943)
   org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
   org.springframework.orm.hibernate3.HibernateTemplate.findByNamedQueryAndNamedParam(HibernateTemplate.java:934)
   com.issworld.simiss.dao.hibernate.HibernateSimISSDao.getCalculationByOfferVersion(HibernateSimISSDao.java:628)
   com.issworld.simiss.service.OfferVersionService.getCalcSheet(OfferVersionService.java:1342)
   com.issworld.simiss.service.OfferVersionService.getVipCalculationsWithBenchmarks(OfferVersionService.java:1763)
   com.issworld.simiss.service.OfferVersionService$$FastClassByCGLIB$$ea35a63c.invoke(<generated>)
   net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
   org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:696)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:631)
   com.issworld.simiss.service.OfferVersionService$$EnhancerByCGLIB$$e8c98d33.getVipCalculationsWithBenchmarks(<generated>)
   com.issworld.simiss.web.controller.vip.VipController.lookUpOfferVersions(VipController.java:153)
   com.issworld.simiss.web.controller.vip.VipController.formBackingObject(VipController.java:108)
   org.springframework.web.servlet.mvc.AbstractFormController.getErrorsForNewForm(AbstractFormController.java:358)
   org.springframework.web.servlet.mvc.AbstractFormController.showNewForm(AbstractFormController.java:338)
   org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:278)
   org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
   org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
   org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:859)
   org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:793)
   org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
   org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
   org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
   org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
   org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:106)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
   org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
   org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
   org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)


Top
 Profile  
 
 Post subject: Re: UncategorizedSQLException when fetching data
PostPosted: Fri Jul 24, 2009 11:15 am 
Newbie

Joined: Fri Jul 24, 2009 11:06 am
Posts: 8
The stack trace is for an update and not a fetch. So probably your fetch is working fine.


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.