-->
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.  [ 1 post ] 
Author Message
 Post subject: Mapping Clob to UserDefined Object
PostPosted: Tue Mar 27, 2007 1:21 am 
Newbie

Joined: Tue Mar 27, 2007 12:41 am
Posts: 1
Hi All,

We are facing the following exception when we try to fetch the information from the database. Please see below for complete stack trace.

Note:
1) Here we have mapped a CLOB column of Database to user defined object (template).

2) Required behaviour : Hibernate should be able to populate the user defined object (template) automatically from the CLOB data.

3) This mapping of the object was working perfectly fine when we have used MySQL 4.3. Just that when we moved to Oracle 10g this query stopped to work.

4) I have verified that the query generated (after doing show_sql = true)
is running perfectly fine if I execute it directly on the SQL Editor. Hence the issue lies that Hibernate now is unable to populate the object from the CLOB.

Any pointers in resolving the above is greatly appreciated.

Thanks,
Shipra


Hibernate version:
3.0

Mapping documents:
<property name="template" column="template" type="serializable" />

Where template is of ReportTemplateType user defined object.

Full stack trace of any exception that occurs:

[27 Mar 2007 10:30:19,027 WARN JDBCExceptionReporter] SQL Error: 17023, SQLState: null
[27 Mar 2007 10:30:19,059 ERROR JDBCExceptionReporter] Unsupported feature
[27 Mar 2007 10:30:19,059 ERROR ReportTemplateDAO] EXCEPTION: com.be.bss.report.exception.ReportTemplateDAOException,
MESSAGE: Failed to get report template list!;
CAUSE: (org.hibernate.exception.GenericJDBCException: could not execute query)
at com.be.bss.report.dao.ReportTemplateDAO.getReportTemplateList(ReportTemplateDAO.java:107)
at com.be.bss.report.service.ListReportTemplateService.service(ListReportTemplateService.java:77)
at com.be.bss.framework.service.ServiceHelper.executeService(ServiceHelper.java:83)
at com.be.bss.report.struts.action.ListReportTemplateAction.process(ListReportTemplateAction.java:62)
at com.be.bss.csa.struts.action.CSABaseAction.executeAction(CSABaseAction.java:64)
at com.be.bss.struts.action.BaseStrutsAction.execute(BaseStrutsAction.java:137)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
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.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.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)
Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:1518)
at org.hibernate.loader.Loader.list(Loader.java:1498)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:266)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:788)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at com.be.bss.report.dao.ReportTemplateDAO.getReportTemplateList(ReportTemplateDAO.java:84)
... 25 more
Caused by: java.sql.SQLException: Unsupported feature
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:190)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:286)
at oracle.jdbc.driver.DatabaseError.throwUnsupportedFeatureSqlException(DatabaseError.java:736)
at oracle.jdbc.driver.ClobAccessor.getBytes(ClobAccessor.java:279)
at oracle.jdbc.driver.OracleResultSetImpl.getBytes(OracleResultSetImpl.java:973)
at oracle.jdbc.driver.OracleResultSet.getBytes(OracleResultSet.java:1625)
at org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.getBytes(DelegatingResultSet.java:252)
at org.hibernate.type.BinaryType.get(BinaryType.java:64)
at org.hibernate.type.SerializableType.get(SerializableType.java:34)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:77)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:68)
at org.hibernate.type.AbstractType.hydrate(AbstractType.java:80)
at org.hibernate.persister.entity.BasicEntityPersister.hydrate(BasicEntityPersister.java:1703)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:918)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:874)
at org.hibernate.loader.Loader.getRow(Loader.java:787)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:293)
at org.hibernate.loader.Loader.doQuery(Loader.java:387)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:206)
at org.hibernate.loader.Loader.doList(Loader.java:1515)
... 31 more


Name and version of the database you are using:
Oracle 10g


The generated SQL (show_sql=true):
select reporttemp0_.id as id, reporttemp0_.name as name34_, reporttemp0_.template as template34_, reporttemp0_.xml_template as xml4_34_, reporttemp0_.description as descript5_34_, reporttemp0_.createDate as createDate34_, reporttemp0_.lastModifyDate as lastModi7_34_ from report_template reporttemp0_





Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.