-->
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.  [ 6 posts ] 
Author Message
 Post subject: Hibernate or SAP DB Driver problem/question
PostPosted: Thu Nov 27, 2003 11:50 am 
Beginner
Beginner

Joined: Thu Oct 09, 2003 11:41 am
Posts: 39
Location: Paris, France
Hi,

I have the following mapping

Code:
<class name="workflow.WorkflowProject" table="workflow_project">
    <id name="id" column="workflow_project_id" type="long">
         <generator class="hilo"/>
    </id>
... various properties ...
  </class>

  <class name="workflow.WorkflowUserPool" table="workflow_user_pool">
    <id name="id" column="workflow_user_pool_id" type="long">
         <generator class="hilo"/>
    </id>

   <many-to-one name="project" class="workflow.WorkflowProject" column="workflow_project_id" cascade="save-update" />
  </class>


use_outer_join is set to true. When I run the following query:

Code:
FROM workflow.WorkflowProject workflow_project, workflow.WorkflowUserPool workflow_user_pool WHERE workflow_user_pool.project = workflow_project


Hibernate generates the correct SQL query but crashes

Code:
select [columns list]
from workflow_project workflow0_, workflow_user_pool workflow1_
where (workflow1_.workflow_project_id=workflow0_.workflow_project_id)


The error is as follows:

Code:
com.sap.dbtech.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: Column index 1 was not found.
        at com.sap.dbtech.jdbc.CallableStatementSapDB.findColInfo(CallableStatementSapDB.java:740)
        at com.sap.dbtech.jdbc.CallableStatementSapDB.setString(CallableStatementSapDB.java:1883)
        at net.sf.hibernate.type.StringType.set(StringType.java:22)
        at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:46)
        at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:31)
        at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:494)
        at net.sf.hibernate.loader.Loader.doFind(Loader.java:136)
        at net.sf.hibernate.loader.Loader.find(Loader.java:620)
        at net.sf.hibernate.hql.QueryTranslator.find(QueryTranslator.java:928)
        at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1343)
        at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1322)
        at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1318)
        at UserProjectsList.<init>(UserProjectsList.java:72)
        at LogonAction.execute(LogonAction.java:166)
        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 ActionServlet.process(ActionServlet.java:34)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
        at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
        at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
        at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
        at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
        at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
        at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
        at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
        at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
        at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
        at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
        at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
        at java.lang.Thread.run(Thread.java:534)


Am I doing something wrong, or is it a driver problem?

I'm using SAP DB / MAX DB 7.5.00.05 with correct drivers.

Thanks,


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 27, 2003 12:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
This is an incredibly wierd one....


can I see the Hibernate debug log, including the net.sf.hibernate.type category .... TIA


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 27, 2003 12:25 pm 
Beginner
Beginner

Joined: Thu Oct 09, 2003 11:41 am
Posts: 39
Location: Paris, France
gavin wrote:
This is an incredibly wierd one....


can I see the Hibernate debug log, including the net.sf.hibernate.type category .... TIA


Here is the relevant piece of debug log:


DEBUG HttpProcessor[8080][4] net.sf.hibernate.impl.SessionImpl - find: FROM net.bookingasp.workflow.WorkflowProject workflow_project, net.bookingasp.workflow.WorkflowUserPool workflow_user_pool WHERE workflow_user_pool.project = workflow_project
DEBUG HttpProcessor[8080][4] net.sf.hibernate.impl.SessionImpl - parameters: 1
DEBUG HttpProcessor[8080][4] net.sf.hibernate.hql.QueryTranslator - compiling query
DEBUG HttpProcessor[8080][4] net.sf.hibernate.impl.SessionImpl - flushing session
DEBUG HttpProcessor[8080][4] net.sf.hibernate.impl.SessionImpl - Flushing entities and processing referenced collections
DEBUG HttpProcessor[8080][4] net.sf.hibernate.impl.SessionImpl - Processing unreferenced collections
DEBUG HttpProcessor[8080][4] net.sf.hibernate.impl.SessionImpl - Scheduling collection removes/(re)creates/updates
DEBUG HttpProcessor[8080][4] net.sf.hibernate.impl.SessionImpl - Flushed: 0 insertions, 0 updates, 0 deletions to 1 objects
DEBUG HttpProcessor[8080][4] net.sf.hibernate.impl.SessionImpl - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
DEBUG HttpProcessor[8080][4] net.sf.hibernate.impl.SessionImpl - Dont need to execute flush
DEBUG HttpProcessor[8080][4] net.sf.hibernate.hql.QueryTranslator - HQL: FROM net.bookingasp.workflow.WorkflowProject workflow_project, net.bookingasp.workflow.WorkflowUserPool workflow_user_pool WHERE workflow_user_pool.project = workflow_project
DEBUG HttpProcessor[8080][4] net.sf.hibernate.hql.QueryTranslator - SQL: select workflow0_.workflow_project_id as workflow_project_id0_, workflow1_.workflow_user_pool_id as workflow_user_pool_id1_, workflow0_.workflow_project_title as workflow2_0_, workflow0_.last_update_datetime as last_upd3_0_, workflow0_.last_update_by_user_id as last_upd4_0_, workflow0_.workflow_owner_user_id as workflow5_0_, workflow0_.workflow_creation_datetime as workflow6_0_, workflow0_.workflow_resp_user_id as workflow7_0_, workflow1_.workflow_project_id as workflow2_1_, workflow1_.workflow_owner_user_id as workflow3_1_, workflow1_.workflow_user_id as workflow4_1_ from workflow_project workflow0_, workflow_user_pool workflow1_ where (workflow1_.workflow_project_id=workflow0_.workflow_project_id )
DEBUG HttpProcessor[8080][4] net.sf.hibernate.impl.BatcherImpl - about to open: 0 open PreparedStatements, 0 open ResultSets
DEBUG HttpProcessor[8080][4] net.sf.hibernate.impl.SessionFactoryImpl - prepared statement get: select workflow0_.workflow_project_id as workflow_project_id0_, workflow1_.workflow_user_pool_id as workflow_user_pool_id1_, workflow0_.workflow_project_title as workflow2_0_, workflow0_.last_update_datetime as last_upd3_0_, workflow0_.last_update_by_user_id as last_upd4_0_, workflow0_.workflow_owner_user_id as workflow5_0_, workflow0_.workflow_creation_datetime as workflow6_0_, workflow0_.workflow_resp_user_id as workflow7_0_, workflow1_.workflow_project_id as workflow2_1_, workflow1_.workflow_owner_user_id as workflow3_1_, workflow1_.workflow_user_id as workflow4_1_ from workflow_project workflow0_, workflow_user_pool workflow1_ where (workflow1_.workflow_project_id=workflow0_.workflow_project_id )
DEBUG HttpProcessor[8080][4] net.sf.hibernate.ps.PreparedStatementCache - preparing statement: select workflow0_.workflow_project_id as workflow_project_id0_, workflow1_.workflow_user_pool_id as workflow_user_pool_id1_, workflow0_.workflow_project_title as workflow2_0_, workflow0_.last_update_datetime as last_upd3_0_, workflow0_.last_update_by_user_id as last_upd4_0_, workflow0_.workflow_owner_user_id as workflow5_0_, workflow0_.workflow_creation_datetime as workflow6_0_, workflow0_.workflow_resp_user_id as workflow7_0_, workflow1_.workflow_project_id as workflow2_1_, workflow1_.workflow_owner_user_id as workflow3_1_, workflow1_.workflow_user_id as workflow4_1_ from workflow_project workflow0_, workflow_user_pool workflow1_ where (workflow1_.workflow_project_id=workflow0_.workflow_project_id )
DEBUG HttpProcessor[8080][4] net.sf.hibernate.type.StringType - binding '1' to parameter: 1
DEBUG HttpProcessor[8080][4] net.sf.hibernate.util.JDBCExceptionReporter - SQL Exception
com.sap.dbtech.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: Column index 1 was not found.
at com.sap.dbtech.jdbc.CallableStatementSapDB.findColInfo(CallableStatementSapDB.java:740)
at com.sap.dbtech.jdbc.CallableStatementSapDB.setString(CallableStatementSapDB.java:1883)
at net.sf.hibernate.type.StringType.set(StringType.java:22)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:46)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:31)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:494)
at net.sf.hibernate.loader.Loader.doFind(Loader.java:136)
at net.sf.hibernate.loader.Loader.find(Loader.java:620)
at net.sf.hibernate.hql.QueryTranslator.find(QueryTranslator.java:928)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1343)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1322)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1318)
at net.bookingasp.UserProjectsList.<init>(UserProjectsList.java:72)
at net.bookingasp.LogonAction.execute(LogonAction.java:166)
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 net.bookingasp.ActionServlet.process(ActionServlet.java:34)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:534)
WARN HttpProcessor[8080][4] net.sf.hibernate.util.JDBCExceptionReporter - SQL Error: -1, SQLState:
ERROR HttpProcessor[8080][4] net.sf.hibernate.util.JDBCExceptionReporter - SAP DBTech JDBC: Column index 1 was not found.
DEBUG HttpProcessor[8080][4] net.sf.hibernate.impl.BatcherImpl - done closing: 0 open PreparedStatements, 0 open ResultSets
DEBUG HttpProcessor[8080][4] net.sf.hibernate.ps.PreparedStatementCache - recaching
DEBUG HttpProcessor[8080][4] net.sf.hibernate.ps.PreparedStatementCache - total checked-out statements: 0
DEBUG HttpProcessor[8080][4] net.sf.hibernate.ps.PreparedStatementCache - checked out: []
ERROR HttpProcessor[8080][4] net.sf.hibernate.util.JDBCExceptionReporter - Could not execute query
com.sap.dbtech.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: Column index 1 was not found.
at com.sap.dbtech.jdbc.CallableStatementSapDB.findColInfo(CallableStatementSapDB.java:740)
at com.sap.dbtech.jdbc.CallableStatementSapDB.setString(CallableStatementSapDB.java:1883)
at net.sf.hibernate.type.StringType.set(StringType.java:22)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:46)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:31)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:494)
at net.sf.hibernate.loader.Loader.doFind(Loader.java:136)
at net.sf.hibernate.loader.Loader.find(Loader.java:620)
at net.sf.hibernate.hql.QueryTranslator.find(QueryTranslator.java:928)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1343)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1322)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1318)
at net.bookingasp.UserProjectsList.<init>(UserProjectsList.java:72)
at net.bookingasp.LogonAction.execute(LogonAction.java:166)
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 net.bookingasp.ActionServlet.process(ActionServlet.java:34)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:534)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 27, 2003 12:41 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Oh, of course. Silly me.

Why are you passing a parameter to a query which has no parameters?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 27, 2003 12:46 pm 
Beginner
Beginner

Joined: Thu Oct 09, 2003 11:41 am
Posts: 39
Location: Paris, France
gavin wrote:
Oh, of course. Silly me.

Why are you passing a parameter to a query which has no parameters?


Oops. Weird. It's almost Friday, you know. :-)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 27, 2003 12:48 pm 
Beginner
Beginner

Joined: Thu Oct 09, 2003 11:41 am
Posts: 39
Location: Paris, France
gavin wrote:
Oh, of course. Silly me.

Why are you passing a parameter to a query which has no parameters?


Thanks (nearly forgot)!


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