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: make_statement error with oracle oci and pl/sql
PostPosted: Wed Dec 14, 2005 6:43 am 
Newbie

Joined: Wed Sep 07, 2005 4:54 am
Posts: 4
I'm using a hibernate session, to get a database-Connection for executing an Oracle Stored Procedure, which returns a cursor.
The statement/Javafunction works on my client, but on the server an exception is thrown:

java.lang.UnsatisfiedLinkError: make_statement
oracle.jdbc.oci8.OCIDBAccess.make_statement(Native Method)


The configuration of bove systems is equal.

Hibernate version: 3.0


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

Code:
Session session = null;
      Connection con = null;      
      CallableStatement cstmt;
      ResultSet cursor;
      String query;

      
   [...]   
            
      
      // the query uses showRepDefectHistory of package AWM, which returns a cursor
      query = "begin ? := mecis_owner.awm.showRepDefectHistory(?,?); end;";
      

      try {
         session = SessionFactory.currentSession();
         // load the defect
         con = session.connection();
         cstmt = con.prepareCall(query);
         
         cstmt.registerOutParameter(1, OracleTypes.CURSOR);
         
         cstmt.setString(2, matNr);
         cstmt.setString(3, serNr);

         cstmt.execute();
         
         [color=red]cursor = (ResultSet)cstmt.getObject(1); // LINE 463!!! which causes the exception[/color]
[...]

session.close();   


Full stack trace of any exception that occurs:

2005-12-13 09:01:20 StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
java.lang.UnsatisfiedLinkError: make_statement
at oracle.jdbc.oci8.OCIDBAccess.make_statement(Native Method)
at oracle.jdbc.oci8.OCIDBAccess.RefCursorBytesToDBStatement(OCIDBAccess.java:2373)
at oracle.jdbc.driver.OracleStatement.getCursorValue(OracleStatement.java:3670)
at oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:5792)
at oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:5622)
at oracle.jdbc.driver.OracleCallableStatement.getObject(OracleCallableStatement.java:698)
at com.roche.hibernate.Defekt.getDefectRepHistory(Defekt.java:463)
at com.roche.struts.awm.action.DefectDescriptionAction.execute(DefectDescriptionAction.java:118)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at com.roche.struts.filter.LoginFilter.doFilter(LoginFilter.java:90)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Unknown Source)




Name and version of the database you are using:

Oracle 9i R2 9.2.0.6

The generated SQL (show_sql=true):

[...]
Hibernate: select vbearbeite0_.BEARBEITER_ID as BEARBEITER1_0_, vbearbeite0_.BEARBEITER_ID as BEARBEITER1_6_0_, vbearbeite0_.BENUTZERNAME as BENUTZER2_6_0_, vbearbeite0_.VORNAME as VORNAME6_0_, vbearbeite0_.NAME as NAME6_0_, vbearbeite0_.RECHTE as RECHTE6_0_, vbearbeite0_.BERECHTIGUNG as BERECHTI6_6_0_, vbearbeite0_.BEMERKUNG as BEMERKUNG6_0_ from V_BEARBEITER vbearbeite0_ where vbearbeite0_.BEARBEITER_ID=?
Hibernate: select count(*) as col_0_0_ from OBJEKTDEF objektdef0_ where objektdef0_.MATERIALNR=?
Hibernate: select objektdef0_.MATERIALNR as col_0_0_ from OBJEKTDEF objektdef0_ where upper(objektdef0_.MATERIALNR_ALT)=upper(?)
Hibernate: select count(*) as col_0_0_ from OBJEKTDEF objektdef0_ where objektdef0_.MATERIALNR=?
Hibernate: select objektdef0_.MATERIALNR as col_0_0_ from OBJEKTDEF objektdef0_ where upper(objektdef0_.MATERIALNR_ALT)=upper(?)
Hibernate: select count(*) as col_0_0_ from OBJEKTDEF objektdef0_ where objektdef0_.MATERIALNR=?
Hibernate: select objektdef0_.MATERIALNR as col_0_0_ from OBJEKTDEF objektdef0_ where upper(objektdef0_.MATERIALNR_ALT)=upper(?)
Hibernate: select count(*) as col_0_0_ from OBJEKTDEF objektdef0_ where objektdef0_.MATERIALNR=?
Hibernate: select objektdef0_.MATERIALNR as MATERIALNR0_, objektdef0_.BEZEICHNUNG as BEZEICHN2_5_0_, objektdef0_.TYP as TYP5_0_, objektdef0_.AKTUELLE_REV as AKTUELLE4_5_0_, objektdef0_.AKTUELLE_VERS as AKTUELLE5_5_0_, objektdef0_.MATERIALNR_ALT as MATERIALNR6_5_0_ from OBJEKTDEF objektdef0_ where objektdef0_.MATERIALNR=?
Hibernate: select count(*) as col_0_0_ from OBJEKTDEF objektdef0_ where objektdef0_.MATERIALNR=?
Hibernate: select objektdef0_.MATERIALNR as col_0_0_ from OBJEKTDEF objektdef0_ where upper(objektdef0_.MATERIALNR_ALT)=upper(?)
Hibernate: select count(*) as col_0_0_ from OBJEKTDEF objektdef0_ where objektdef0_.MATERIALNR=?
Hibernate: select objektdef0_.MATERIALNR as col_0_0_ from OBJEKTDEF objektdef0_ where upper(objektdef0_.MATERIALNR_ALT)=upper(?)
Hibernate: select count(*) as col_0_0_ from OBJEKTDEF objektdef0_ where objektdef0_.MATERIALNR=?
Hibernate: select count(*) as col_0_0_ from OBJEKTDEF objektdef0_ where objektdef0_.MATERIALNR=?
Hibernate: select objektdef0_.MATERIALNR as col_0_0_ from OBJEKTDEF objektdef0_ where upper(objektdef0_.MATERIALNR_ALT)=upper(?)
Hibernate: select count(*) as col_0_0_ from OBJEKTDEF objektdef0_ where objektdef0_.MATERIALNR=?
Hibernate: select objekt0_.OBJEKT_ID as col_0_0_ from OBJEKT objekt0_ where objekt0_.MATERIALNR=? and objekt0_.SERIENNR=? and (objekt0_.REVNR is not null)
Hibernate: select standort0_.STANDORT_ID as col_0_0_, standort0_.BEZEICHNUNG as col_1_0_ from STANDORT standort0_
Hibernate: select defektdef0_.DEFEKTDEF_ID as col_0_0_, defektdef0_.BEZEICHNUNG as col_1_0_ from DEFEKTDEF defektdef0_

==> Comment: Of course there are no statements caused of above database-query. But you can see - the connection and other hibernate-queries still work.

Has anybody an idea what is going wronge?

greetings
Martin


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.