-->
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: Calling a function from Hibernate - Help
PostPosted: Tue Jan 08, 2008 5:47 pm 
Newbie

Joined: Tue Jan 08, 2008 5:40 pm
Posts: 2
Hi,

I'm trying to call a stored procedure in Hibernate but I'm getting an exception. Does anybody know what the problem is?

I'm sure the function exists, verified it a thousand times.

Cheers,
Paulo

Hibernate version:
Hibernate 3.2

Code between sessionFactory.openSession() and session.close():
Code:
SQLQuery query = sessionFactory.getCurrentSession().createSQLQuery("call PICAGE.PKG_SLA_CORR.IMPORT_FILE_CORR_DADOS(?, ?)");
         query = query.addEntity("impExpImportedCSV"); 
         results = query.setParameter(1, ficheiro, Hibernate.BLOB).setParameter(0, hash, Hibernate.STRING).list();


Full stack trace of any exception that occurs:
Code:
E   TRAS0014I: The following exception was logged org.hibernate.exception.SQLGrammarException: could not execute query
   at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
   at org.hibernate.loader.Loader.doList(Loader.java:2223)
   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 picage.model.entity.ImpExpHome.importCSV(ImpExpHome.java)
   at picage.model.util.ImpExpCorrDados.importCSV(ImpExpCorrDados.java:280)
   at picage.actions.impexp.CorreccaoDadosAction.importFile(CorreccaoDadosAction.java:355)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
   at java.lang.reflect.Method.invoke(Method.java:391)
   at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
   at picage.actions.impexp.CorreccaoDadosAction.dispatchMethod(CorreccaoDadosAction.java:87)
   at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
   at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
   at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
   at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
   at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
   at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
   at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
   at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
   at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
   at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1173)
   at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)
   at picage.utils.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:93)
   at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
   at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:77)
   at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:626)
   at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
   at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1657)
   at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
   at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
   at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
   at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:292)
   at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:201)
   at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:103)
   at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
   at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601)
   at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
   at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
   at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)
Caused by: java.sql.SQLException: ORA-06576: not a valid function or procedure name


Name and version of the database you are using:
Oracle 10g[/code]


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.