-->
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: Exception using Access 97
PostPosted: Tue Sep 16, 2003 11:07 am 
Newbie

Joined: Tue Sep 02, 2003 1:12 pm
Posts: 10
Hi,

Unfortunatelly I had to migrate from SQL Server 2000 to Access 97 due to requirements of the company where I work. I found out that Hibernate does not have official support for Access, but some people are using it with sucess. Well, I tried JDBC-ODBC bridge and it worked with Hibernate, however I get this exception:



Code:
2003-09-16 11:55:32,171 WARN  hibernate.impl.BatcherImpl  -> exception clearing maxRows/queryTimeout
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]Optional feature not implemented
   at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6879)
   at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7036)
   at sun.jdbc.odbc.JdbcOdbc.SQLGetStmtOption(JdbcOdbc.java:4371)
   at sun.jdbc.odbc.JdbcOdbcStatement.getStmtOption(JdbcOdbcStatement.java:1208)
   at sun.jdbc.odbc.JdbcOdbcStatement.getQueryTimeout(JdbcOdbcStatement.java:697)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.getQueryTimeout(DelegatingPreparedStatement.java:188)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.getQueryTimeout(DelegatingPreparedStatement.java:188)
   at net.sf.hibernate.impl.BatcherImpl.closeQueryStatement(BatcherImpl.java:122)
   at net.sf.hibernate.impl.BatcherImpl.closeQueryStatement(BatcherImpl.java:87)
   at net.sf.hibernate.loader.Loader.closeQueryStatement(Loader.java:566)
   at net.sf.hibernate.loader.Loader.doFind(Loader.java:190)
   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:1314)


It seems to be a problem with getQueryTimeout. I want to know if it is critical, because the updates, deletes and insert are occuring correctly. Could I simply ignore this exception?

Thank you

_________________
Henrique Velloso
--------------------
System Architect
FUNDEP - UFMG - BRAZIL


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 16, 2003 1:24 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Nah, its not critical.


Top
 Profile  
 
 Post subject: Cloudscape
PostPosted: Tue Dec 16, 2003 4:25 pm 
Beginner
Beginner

Joined: Tue Oct 07, 2003 12:11 pm
Posts: 32
Location: US
I get the same issue with cloudscape DB.
I guess that Hibernate does not have official support for Cloudscape as well.

BatcherImpl.java:125, closeQueryStatement) - exception clearing maxRows/queryTimeout

SQL Exception: Feature not implemented: getQueryTimeout.

I didn't take this as a critical issue. Please correct me if this was a critical issue.

But when I use similar code,


Code:
The code:

          //
          // Retrieve data, using query
          //
          queryString = "from " + persistentTOClassname +
              " as t1 where t1.oid = :oid";

          query = getQuery(queryString);
          query.setLong("oid", pk);

          Iterator it = query.iterate();

          if (it.hasNext())
            persTO = it.next();  // fetch the record


I get a SQL Exception: Feature not implemented: getQueryTimeout
Then I get LazyInitializationException. This is when i am at line it.next()

Code:

Caused by: net.sf.hibernate.LazyInitializationException: Hibernate lazy instantiation problem: ResultSet not open, operation next not permitted. Verify that autocommit is OFF.

at net.sf.hibernate.impl.IteratorImpl.next(IteratorImpl.java:81)



Is this related with the ResultSet time out? as getQueryTimeout() and setQueryTimeout() didn't work for Cloudscape ?


Top
 Profile  
 
 Post subject: How do we suppress the stacktrace
PostPosted: Tue Dec 16, 2003 5:59 pm 
Beginner
Beginner

Joined: Tue Oct 07, 2003 12:11 pm
Posts: 32
Location: US
How do we suppress the stacktrace logged for

Code:
query.iterate() or query.list()



for
Code:
SQL Exception: Feature not implemented: getQueryTimeout
(while using Cloudscape I get this as WARN log in Hibernate)



The inclusion of this error being logged is going to generate a lot of questions, and when you encounter an actual error and are reviewing the log, having this ignorable stack trace slows down the diagnostic process by drawing attention away from the actual cause in the log.

Any help would be appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 16, 2003 9:20 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
well, you can trivially easily patch Hibernate

as you observe, Cloudscape is not officially supported.


Top
 Profile  
 
 Post subject: Patch Hibernate
PostPosted: Wed Dec 17, 2003 9:49 am 
Beginner
Beginner

Joined: Tue Oct 07, 2003 12:11 pm
Posts: 32
Location: US
As you said, I could patch Hibernate, is there a preferred way to suppress the stacktrace logged for SQL Exception: Feature not implemented: getQueryTimeout ?


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.