-->
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.  [ 10 posts ] 
Author Message
 Post subject: Problem of generate SQL
PostPosted: Thu Mar 18, 2004 9:57 pm 
Newbie

Joined: Thu Mar 18, 2004 9:42 pm
Posts: 3
hi , during testing hibernate

env: Redhat8.0 + tomcat4.1.27 + jdk1.3.1_09 + cocoon2.1.2 + hibernate2.1.2 + progress 91D

problem: SQL generated cannot be executed

in tomcat log file, the following SQL had been genereated :

Hibernate: select ywod0_.ywod_lot as ywod_lot, ywod0_.ywod_model as ywod_model, ywod0_.ywod_prodline as ywod_pro3_ from PUB.ywod_det ywod0_ where (ywod0_.ywod_lot=? )
- exception clearing maxRows/queryTimeout
java.sql.SQLException: [JDBC Progress Driver]:Optional feature not implemented.
at com.progress.sql.jdbc.JdbcProgress.createSQLException(JdbcProgress.ja
va:6562)
at com.progress.sql.jdbc.JdbcProgress.standardError(JdbcProgress.java:67
36)
at com.progress.sql.jdbc.JdbcProgress.SQLGetStmtOption(JdbcProgress.java
:4121)
at com.progress.sql.jdbc.JdbcProgressStatement.getStmtOption(JdbcProgres
sStatement.java:1261)

in each fields and table name , "ywod0_" is added , get rid of it , the SQL should be OK.

Ywod.hbm.xml :

<hibernate-mapping>
<class name="opsetup.Ywod" table="ywod_det">

<id name="lotno" column="ywod_lot" type="string">
<generator class="assigned"/>
</id>

<property name="part" column="ywod_model" type="string"/>
<property name="prodline" column="ywod_prodline" type="string"/>
</class>
</hibernate-mapping>

hibernate.properties:

hibernate.connection.datasource = java:comp/env/jdbc/progress
hibernate.dialect = net.sf.hibernate.dialect.ProgressDialect
hibernate.show_sql = true
hibernate.default_schema = PUB

in the java class :

List wos = hs.find("from opsetup.Ywod as ywod where ywod.lotno = ?", WoLot ,Hibernate.STRING);

the above seems a problem of naming strategy problem ? any ideas ?

thanks in advance,
best regards,
j.j.zheng


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 19, 2004 10:52 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Thats surely a problem of your database, which does not support table name aliases. I am pretty sure Hibernate won't work without.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 20, 2004 11:35 am 
Newbie

Joined: Thu Mar 18, 2004 9:42 pm
Posts: 3
thanks a lot ,

but after consulting to the database vendor PROGRESS then testing , it is made sure that PROGRESS 91D did support table and field aliases. any comments ?

best regards.
j.j.zheng


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 20, 2004 12:00 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Well you said it works without the ywod0_ aliases, and does not work with them. Sounds pretty much like table name aliases are not supported to me.

Probably you should rather post the full error stacktrace and try disabling prepared statement caching.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 21, 2004 10:57 pm 
Newbie

Joined: Thu Mar 18, 2004 9:42 pm
Posts: 3
sorry , i didn't know table and fields could have aliases before , could you please advise how to disable prepared statement caching? i cannot find it in the document and forum .

the bellow is the full error tomcat log

09:03:38,066 INFO Environment:432 - Hibernate 2.1.1
09:03:38,089 INFO Environment:466 - loaded properties from resource hibernate.properties: {hibernate.default_schema=PUB, hibernate.cglib.use_reflection_optimizer=true, hibernate.dialect=net.sf.hibernate.dialect.ProgressDialect, hibernate.show_sql=true, hibernate.connection.datasource=java:comp/env/jdbc/progress}
09:03:38,094 INFO Environment:481 - using CGLIB reflection optimizer
09:03:38,096 INFO Environment:504 - JVM does not support LinkedHasMap, LinkedHashSet - ordered maps and sets disabled
09:03:38,097 INFO Environment:507 - using workaround for JVM bug in java.sql.Timestamp
09:03:38,105 INFO Configuration:318 - Mapping resource: opsetup/Ywod.hbm.xml
09:03:38,433 INFO Binder:225 - Mapping class: opsetup.Ywod -> ywod_det
09:03:38,609 INFO Configuration:584 - processing one-to-many association mappings
09:03:38,610 INFO Configuration:593 - processing one-to-one association property references
09:03:38,611 INFO Configuration:618 - processing foreign key constraints
09:03:38,660 INFO Dialect:82 - Using dialect: net.sf.hibernate.dialect.ProgressDialect
09:03:38,662 INFO SettingsFactory:62 - Use outer join fetching: false
09:03:38,675 INFO NamingHelper:26 - JNDI InitialContext properties:{}
09:03:38,712 INFO DatasourceConnectionProvider:51 - Using datasource: java:comp/env/jdbc/progress
09:03:38,730 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
09:03:41,384 INFO SettingsFactory:89 - Use scrollable result sets: true
09:03:41,385 INFO SettingsFactory:93 - Default schema set to: PUB
09:03:41,387 INFO SettingsFactory:96 - echoing all SQL to stdout
09:03:41,388 INFO SettingsFactory:99 - Query language substitutions: {}
09:03:41,389 INFO SettingsFactory:110 - cache provider: net.sf.ehcache.hibernate.Provider
09:03:41,397 INFO Configuration:1057 - instantiating and configuring caches
09:03:42,170 INFO SessionFactoryImpl:119 - building session factory
09:03:42,555 INFO SessionFactoryObjectFactory:82 - no JNDI name configured
1234567
09:03:42,737 DEBUG SQL:223 - select ywod0_.ywod_lot as ywod_lot, ywod0_.ywod_model as ywod_model, ywod0_.ywod_prodline as ywod_pro3_ from PUB.ywod_det ywod0_ where (ywod0_.ywod_lot=? )
Hibernate: select ywod0_.ywod_lot as ywod_lot, ywod0_.ywod_model as ywod_model, ywod0_.ywod_prodline as ywod_pro3_ from PUB.ywod_det ywod0_ where (ywod0_.ywod_lot=? )
09:03:43,063 DEBUG StringType:46 - binding '1234567' to parameter: 1
09:03:43,089 WARN BatcherImpl:143 - exception clearing maxRows/queryTimeout
java.sql.SQLException: [JDBC Progress Driver]:Optional feature not implemented.
at com.progress.sql.jdbc.JdbcProgress.createSQLException(JdbcProgress.java:6562)
at com.progress.sql.jdbc.JdbcProgress.standardError(JdbcProgress.java:6736)
at com.progress.sql.jdbc.JdbcProgress.SQLGetStmtOption(JdbcProgress.java:4121)
at com.progress.sql.jdbc.JdbcProgressStatement.getStmtOption(JdbcProgressStatement.java:1261)
at com.progress.sql.jdbc.JdbcProgressStatement.getQueryTimeout(JdbcProgressStatement.java:740)
at org.apache.commons.dbcp.DelegatingPreparedStatement.getQueryTimeout(DelegatingPreparedStatement.java:214)
at net.sf.hibernate.impl.BatcherImpl.closeQueryStatement(BatcherImpl.java:140)
at net.sf.hibernate.impl.BatcherImpl.closeQueryStatement(BatcherImpl.java:99)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:233)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132)
at net.sf.hibernate.loader.Loader.doList(Loader.java:949)
at net.sf.hibernate.loader.Loader.list(Loader.java:940)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:833)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1475)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1454)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1450)
at opsetup.ValidYwod.getYwodWithLot(ValidYwod.java:52)
at java.lang.reflect.Method.invoke(Native Method)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:230)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
at org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:1105)
at org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:190)
at org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:138)
at org.mozilla.javascript.continuations.InterpretedFunctionImpl.call(InterpretedFunctionImpl.java:121)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
at org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.callFunction(FOM_JavaScriptInterpreter.java:558)
at org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:181)
at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)
at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:164)
at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:163)
at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:161)
at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:351)
at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:304)
at org.apache.cocoon.Cocoon.process(Cocoon.java:640)
at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1104)
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:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:479)
09:03:43,134 WARN SessionImpl:3241 - afterTransactionCompletion() was never called

thanks a lot.
best regards.
j.j.zheng


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 21, 2004 11:04 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
From the stacktrace, this is clearly a problem between the JDBC driver and DBCP, nothing to do with Hibernate.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 14, 2004 11:59 am 
Newbie

Joined: Thu Oct 14, 2004 11:53 am
Posts: 5
im not using DBCP (actually tested it with the dummie spring implementation org.springframework.jdbc.datasource.DriverManagerDataSource)
and i am still getting this exception.

14.10.2004 17:40:02 net.sf.hibernate.impl.BatcherImpl closeQueryStatement
WARNING: exception clearing maxRows/queryTimeout
java.sql.SQLException: [JDBC Progress Driver]:Optional feature not implemented.
at com.progress.sql.jdbc.JdbcProgress.createSQLException(JdbcProgress.java:6501)
at com.progress.sql.jdbc.JdbcProgress.standardError(JdbcProgress.java:6675)
at com.progress.sql.jdbc.JdbcProgress.SQLGetStmtOption(JdbcProgress.java:4120)
at com.progress.sql.jdbc.JdbcProgressStatement.getStmtOption(JdbcProgressStatement.java:1241)
at com.progress.sql.jdbc.JdbcProgressStatement.getQueryTimeout(JdbcProgressStatement.java:720)
at net.sf.hibernate.impl.BatcherImpl.closeQueryStatement(BatcherImpl.java:148)

as the (type-2) progress jdbc driver is concerned it does not implement getQueryTimeout()

how to get rid of this stack traces? modify BatcherImpl.java or ProgressDialect.java ?

regards
harry


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 14, 2005 1:55 pm 
Newbie

Joined: Mon Nov 14, 2005 12:46 pm
Posts: 10
hi tigerduck
i'm looking for anyone that is working with hibernate + progress db
i'm trying to develop a prototype using both but accessing the progress db through their application server. not jdbc.
what are your impressions on using hibernate + progress?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 14, 2005 2:02 pm 
Newbie

Joined: Thu Oct 14, 2004 11:53 am
Posts: 5
hi,

the progress jdbc driver does not implement all SQL/JDBC methods (like alter table,...). so we finally dont use hibernate + progress and implement good old jdbc+sql.

regards
Harry


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 14, 2005 2:15 pm 
Newbie

Joined: Mon Nov 14, 2005 12:46 pm
Posts: 10
well.. that's a bit of a shock.... although i don't think i'll need ddl capabilites.
anyway i was trying to avoid using jbdc. i wanted to use progress application server...


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