-->
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.  [ 7 posts ] 
Author Message
 Post subject: createSQLQuery - Is it a bug?
PostPosted: Tue Apr 01, 2008 5:31 am 
Senior
Senior

Joined: Mon Feb 25, 2008 1:48 am
Posts: 191
Location: India
Hibernate version: Hibernate 3.0

Code between sessionFactory.openSession() and session.close():

Code:
String sql = Select * from xyz
List resultSet  = session.createSQLQuery(sql).list();


Full stack trace of any exception that occurs:
Code:
org.hibernate.MappingException: No Dialect mapping for JDBC type: -1
   at org.hibernate.dialect.TypeNames.get(TypeNames.java:56)
   at org.hibernate.dialect.TypeNames.get(TypeNames.java:81)
   at org.hibernate.dialect.Dialect.getHibernateTypeName(Dialect.java:370)
   at org.hibernate.loader.custom.CustomLoader$Metadata.getHibernateType(CustomLoader.java:559)
   at org.hibernate.loader.custom.CustomLoader$ScalarResultColumnProcessor.performDiscovery(CustomLoader.java:485)
   at org.hibernate.loader.custom.CustomLoader.autoDiscoverTypes(CustomLoader.java:501)
   at org.hibernate.loader.Loader.getResultSet(Loader.java:1796)
   at org.hibernate.loader.Loader.doQuery(Loader.java:674)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
   at org.hibernate.loader.Loader.doList(Loader.java:2220)
   at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
   at org.hibernate.loader.Loader.list(Loader.java:2099)
   at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
   at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
   at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
   at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
   at com.dnb.rmp.nautilus.comp.datamanager.DataManager.executeSQL(DataManager.java:119)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy0.executeSQL(Unknown Source)
   at com.dnb.rmp.nautilus.dd.faces.model.DataDictionaryForm.onLoad(DataDictionaryForm.java:375)
   at com.dnb.rmp.nautilus.common.faces.model.DefaultPageManager.loadForm(DefaultPageManager.java:441)
   at com.dnb.rmp.nautilus.common.faces.model.DefaultPageManager.setActivePage(DefaultPageManager.java:523)
   at com.dnb.rmp.nautilus.common.faces.model.DefaultPageManager.onTabClick(DefaultPageManager.java:491)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy18.onTabClick(Unknown Source)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.apache.el.parser.AstValue.invoke(AstValue.java:131)
   at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
   at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
   at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1249)
   at org.apache.myfaces.trinidad.component.UIXShowDetail.broadcast(UIXShowDetail.java:147)
   at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:292)
   at javax.faces.component.UIViewRoot.process(UIViewRoot.java:209)
   at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:117)
   at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
   at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
   at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:148)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
   at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
   at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
   at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
   at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
   at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
   at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
   at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Unknown Source)


Name and version of the database you are using: MySQL

The table XYZ has a column of type "TEXT"

Hibernate is unable to identify the datatype "TEXT"

_________________
Sukirtha


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 01, 2008 6:54 am 
Senior
Senior

Joined: Thu May 17, 2007 2:31 am
Posts: 194
Location: Sri Lanka
Hi

please check your configurations


Amila
(Don't forget to rate if helps)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 02, 2008 1:10 am 
Senior
Senior

Joined: Mon Feb 25, 2008 1:48 am
Posts: 191
Location: India
What configurations? Can you please be more clear. I guess the only configuration it needs is the dialect to suit the database that I am using. I am able to execute native queries for other tables in the same schema. This particular table has columns of type TEXT. And thus the problem occurs. I know I can work around the problem by extending the corresponding dialect class and by mapping the TEXT type to a proper hibernate supported type. However, I just wanted to know if that is the only way. Is it a bug or am I doing something wrong?

_________________
Sukirtha


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 02, 2008 1:29 am 
Senior
Senior

Joined: Thu May 17, 2007 2:31 am
Posts: 194
Location: Sri Lanka
Hi

please send more details.

what is the database server
what is the dialact used.

and frame work (spring or other or no framework)


Amila


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 02, 2008 1:42 am 
Senior
Senior

Joined: Mon Feb 25, 2008 1:48 am
Posts: 191
Location: India
Database : MySQL 5.0
Dialect : org.hibernate.dialect.MySQLDialect
Framework Used : Spring

_________________
Sukirtha


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 02, 2008 3:33 am 
Senior
Senior

Joined: Thu May 17, 2007 2:31 am
Posts: 194
Location: Sri Lanka
Hi

try org.hibernate.dialect.MySQL5Dialect


Amila
(Don't forget to rate if helps)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 03, 2008 2:03 am 
Senior
Senior

Joined: Mon Feb 25, 2008 1:48 am
Posts: 191
Location: India
No luck amila. I tried changing the Dialect as u said. But still the same exception occurs. Does hibernate recognize "TEXT" datatype. I guess it does not recognize.

_________________
Sukirtha


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