aduan / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

Add implementation for Methods "isWrapperFor()" and "unwrap()" in JdbcConnection.java #573

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. having a spring jpa (4.0.6) application with hibernate 4.3.6
2. when working in jdbc4 mode following exception is thrown:
Feature not supported: "isWrapperFor" [50100-180]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:345) ~[h2-1.4.180.jar:1.4.180]
    at org.h2.message.DbException.get(DbException.java:179) ~[h2-1.4.180.jar:1.4.180]
    at org.h2.message.DbException.get(DbException.java:155) ~[h2-1.4.180.jar:1.4.180]
    at org.h2.message.DbException.getUnsupportedException(DbException.java:216) ~[h2-1.4.180.jar:1.4.180]
    at org.h2.message.TraceObject.unsupported(TraceObject.java:375) ~[h2-1.4.180.jar:1.4.180]
    at org.h2.jdbc.JdbcStatement.isWrapperFor(JdbcStatement.java:1075) [h2-1.4.180.jar:1.4.180]
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.isTypeOf(ResultSetReturnImpl.java:99) [hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70) [hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    at org.hibernate.loader.Loader.getResultSet(Loader.java:2065) [hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1862) [hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1838) [hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    at org.hibernate.loader.Loader.doQuery(Loader.java:909) [hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:354) [hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    at org.hibernate.loader.Loader.doList(Loader.java:2553) [hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    at org.hibernate.loader.Loader.doList(Loader.java:2539) [hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2369) [hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    at org.hibernate.loader.Loader.list(Loader.java:2364) [hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:496) [hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:387) [hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:231) [hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1264) [hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    at org.hibernate.internal.QueryImpl.list(QueryImpl.java:103) [hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:573) [hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
    at org.hibernate.jpa.internal.QueryImpl.getSingleResult(QueryImpl.java:495) [hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
    at org.hibernate.jpa.criteria.compile.CriteriaQueryTypeQueryAdapter.getSingleResult(CriteriaQueryTypeQueryAdapter.java:71) [hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]

What is the expected output? What do you see instead?
no exception at all

What version of the product are you using? On what operating system, file
system, and virtual machine?
i am using version 1.4.180 on fedora 20

Do you know a workaround?
implementing these 2 methods fixed the exception and made h2 more jdbc 4 
compatible. i tried to add tests but i was unable to run through the testsuite 
without the modification

What is your use case, meaning why do you need this feature?
jdbc 4 compatibility

How important/urgent is the problem for you?
would be a good to implement this one so that the log file is not spammed with 
these exceptions. i know the hibernate is still working without these fixes

Original issue reported on code.google.com by BigMichi1 on 23 Jul 2014 at 8:35

Attachments:

GoogleCodeExporter commented 9 years ago
Can we get a license statement please?

see here for an example:
   http://h2database.com/html/build.html#providing_patches

Original comment by noelgrandin on 23 Jul 2014 at 2:03

GoogleCodeExporter commented 9 years ago
I wrote the code, it's mine, and I'm contributing it to H2 for distribution 
multiple-licensed under the MPL 2.0, and the EPL 1.0 
(http://h2database.com/html/license.html).

Original comment by BigMichi1 on 23 Jul 2014 at 2:16

GoogleCodeExporter commented 9 years ago
Thank you very much, your patch will be available in version 1.4.181

Original comment by noelgrandin on 25 Jul 2014 at 12:50

GoogleCodeExporter commented 9 years ago

Original comment by noelgrandin on 25 Jul 2014 at 12:51