"org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented." Problem

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

"org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented." Problem

Emi Lu
Good afternoon,

Does anyone know what may cause this problem?

org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is
not yet implemented.

Thanks a lot !
Lu Ying

--
Using:
. postgresql-8.4-701.jdbc4.jar
. mybatis-spring-1.0.0-RC3
. mybatis-3.0.3
. spring-framework-3.0.5.RELEASE


. Spring configuration file:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

<bean id="placeholderConfig"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
      <property name = "location">
         <value>WEB-INF/properties/jdbc.properties</value>
      </property>

      <property name = "systemPropertiesModeName">
         <value>SYSTEM_PROPERTIES_MODE_OVERRIDE</value>
      </property>
   </bean>

   <bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource" destroy-
method="close">
      <property name="driverClassName" value="${driverClassName}" />
      <property name="url"      value="${url}" />
      <property name="username" value="${username}" />
      <property name="password" value="${password}" />
   </bean>


   <bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
      <property name="dataSource"     ref="dataSource" />
      <property name="configLocation" value ="WEB-INF/classes/
config.xml" />
   </bean>

</beans>
Reply | Threaded
Open this post in threaded view
|

Re: "org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented." Problem

Guy Rouillier
On 12/1/2010 4:41 PM, Lu Ying wrote:
> Good afternoon,
>
> Does anyone know what may cause this problem?
>
> org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is
> not yet implemented.

Error message seems pretty self-explanatory.  You are calling a method
that is not yet implemented.  I see the following statement on the
PgJDBC project page http://jdbc.postgresql.org/download.html:

"JDK 1.6 - JDBC4. Support for JDBC4 methods is limited. The driver
builds, but the several of the new methods are stubbed out."

Looks like you encountered one of the ones that is stubbed out.

--
Guy Rouillier
Reply | Threaded
Open this post in threaded view
|

Re: "org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented." Problem

Emi Lu
>> Does anyone know what may cause this problem?
>>
>> org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is
>> not yet implemented.
>
> Error message seems pretty self-explanatory. You are calling a method
> that is not yet implemented. I see the following statement on the PgJDBC
> project page http://jdbc.postgresql.org/download.html:


> "JDK 1.6 - JDBC4. Support for JDBC4 methods is limited. The driver
> builds, but the several of the new methods are stubbed out."
>
> Looks like you encountered one of the ones that is stubbed out.

Thank you for the answer Guy!

For JDK1.6, postgresql8.3, struts2, mybatis3, do you know how to fix
this problem?

Would "JDBC3 Postgresql Driver, Version 9.0-801" fixed the problem?

Thank you,
--
Lu Ying
Reply | Threaded
Open this post in threaded view
|

Re: "org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented." Problem

Emi Lu
Good morning List,

>>> Does anyone know what may cause this problem?

>>> org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is
>>> not yet implemented.
>>
>> Error message seems pretty self-explanatory. You are calling a method
>> that is not yet implemented. I see the following statement on the PgJDBC
>> project page http://jdbc.postgresql.org/download.html:
>
>
>> "JDK 1.6 - JDBC4. Support for JDBC4 methods is limited. The driver
>> builds, but the several of the new methods are stubbed out."
>>
>> Looks like you encountered one of the ones that is stubbed out.
>
> Thank you for the answer Guy!
>
> For JDK1.6, postgresql8.3, struts2, mybatis3, do you know how to fix
> this problem?
>
> Would "JDBC3 Postgresql Driver, Version 9.0-801" fixed the problem?

In spring-config.xml:

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">

I think JDBC4 does not support DBCP?

Do you suggest other spring dataSource that is support by MyBatis please?

In mybatis doc, it does not provide dataSource types/choices that users
can use.

Only specify "<bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
   <property name="dataSource" ref="dataSource" />
</bean>" is not good enough.

I would like to know the adv/disadvantages of
<bean id="dataSource" class="1, 2.3...">

It is exactly, id="dataSource" caused the problem I think.

Any suggestions?

Thank you,
Lu Ying



Reply | Threaded
Open this post in threaded view
|

java.lang.NoClassDefFoundError: net/sf/cglib/proxy Error

Emi Lu
Hello List,

I got "java.lang.NoClassDefFoundError:
net/sf/cglib/proxy/MethodInterceptor" Error!

. Spring3.05
. mybatis-spring-1.0.0-RC3
. Struts2
. mybatis3

Could someone help please?

Thank you,
--
Lu Ying



java.lang.NoClassDefFoundError: net/sf/cglib/proxy/MethodInterceptor at
java.lang.ClassLoader.defineClass1(Native Method) at
java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) at
java.lang.ClassLoader.defineClass(ClassLoader.java:616) at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2527)
at
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1010)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1483)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
at
org.apache.ibatis.executor.loader.ResultObjectProxy.createProxy(ResultObjectProxy.java:22)
at
org.apache.ibatis.executor.resultset.FastResultSetHandler.createResultObject(FastResultSetHandler.java:288)
at
org.apache.ibatis.executor.resultset.FastResultSetHandler.getRowValue(FastResultSetHandler.java:188)
at
org.apache.ibatis.executor.resultset.FastResultSetHandler.handleRowValues(FastResultSetHandler.java:145)
at
org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSet(FastResultSetHandler.java:121)
at
org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSets(FastResultSetHandler.java:98)
at
org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:40)
at
org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:55)
at
org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:41) at
org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:216)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:95)
at
org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:72) at
org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:75)
at
org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:69)
at
org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:40)
at Source) at Source) ... 69 more Caused by:
java.lang.ClassNotFoundException: net.sf.cglib.proxy.MethodInterceptor
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
... 94 more

Reply | Threaded
Open this post in threaded view
|

Re: java.lang.NoClassDefFoundError: net/sf/cglib/proxy Error

Simone Tripodi
Ni Hao!
please make suce the cglib.jar is in the classpath, it should fix that
issue; if you're using apache maven, add the following dependency:

    <dependency>
      <groupId>cglib</groupId>
      <artifactId>cglib</artifactId>
      <version>2.1_3</version>
    </dependency>

Hope this helps!
Zai jihan,
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Thu, Dec 2, 2010 at 8:16 PM, Emi Lu <[hidden email]> wrote:

> Hello List,
>
> I got "java.lang.NoClassDefFoundError: net/sf/cglib/proxy/MethodInterceptor"
> Error!
>
> . Spring3.05
> . mybatis-spring-1.0.0-RC3
> . Struts2
> . mybatis3
>
> Could someone help please?
>
> Thank you,
> --
> Lu Ying
>
>
>
> java.lang.NoClassDefFoundError: net/sf/cglib/proxy/MethodInterceptor at
> java.lang.ClassLoader.defineClass1(Native Method) at
> java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) at
> java.lang.ClassLoader.defineClass(ClassLoader.java:616) at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at
> org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2527)
> at
> org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1010)
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1483)
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
> at
> org.apache.ibatis.executor.loader.ResultObjectProxy.createProxy(ResultObjectProxy.java:22)
> at
> org.apache.ibatis.executor.resultset.FastResultSetHandler.createResultObject(FastResultSetHandler.java:288)
> at
> org.apache.ibatis.executor.resultset.FastResultSetHandler.getRowValue(FastResultSetHandler.java:188)
> at
> org.apache.ibatis.executor.resultset.FastResultSetHandler.handleRowValues(FastResultSetHandler.java:145)
> at
> org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSet(FastResultSetHandler.java:121)
> at
> org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSets(FastResultSetHandler.java:98)
> at
> org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:40)
> at
> org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:55)
> at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:41)
> at
> org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:216)
> at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:95) at
> org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:72) at
> org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:75)
> at
> org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:69)
> at
> org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:40)
> at Source) at Source) ... 69 more Caused by:
> java.lang.ClassNotFoundException: net.sf.cglib.proxy.MethodInterceptor at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
> ... 94 more
>
>
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.NoClassDefFoundError: net/sf/cglib/proxy Error

Emi Lu
Ni Hao!

> please make suce the cglib.jar is in the classpath, it should fix that
> issue; if you're using apache maven, add the following dependency:
>
>      <dependency>
>        <groupId>cglib</groupId>
>        <artifactId>cglib</artifactId>
>        <version>2.1_3</version>
>      </dependency>

I added cglib.jar and asm.jar. It seems that fixes the problem.

Thank you!
Lu Ying

Reply | Threaded
Open this post in threaded view
|

Re: "org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented." Problem

Guy Rouillier
In reply to this post by Emi Lu
On 12/2/2010 10:18 AM, Emi Lu wrote:

>>> Does anyone know what may cause this problem?
>>>
>>> org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is
>>> not yet implemented.
>>
>> Error message seems pretty self-explanatory. You are calling a method
>> that is not yet implemented. I see the following statement on the PgJDBC
>> project page http://jdbc.postgresql.org/download.html:
>
>
>> "JDK 1.6 - JDBC4. Support for JDBC4 methods is limited. The driver
>> builds, but the several of the new methods are stubbed out."
>>
>> Looks like you encountered one of the ones that is stubbed out.
>
> Thank you for the answer Guy!
>
> For JDK1.6, postgresql8.3, struts2, mybatis3, do you know how to fix
> this problem?
>
> Would "JDBC3 Postgresql Driver, Version 9.0-801" fixed the problem?

Well, the site says to use the JDBC4 driver if you are using JDK 1.6.
Does the message you identify cause your app to fail?  That message
sounds like it is just informational; failure to set the query timeout
should not be a critical failure.

If this issue does stop your app from working, I'd suggest asking for
help on the PostgreSQL forums.  This would be a driver issue and really
outside of domain of MyBatis.

--
Guy Rouillier
Reply | Threaded
Open this post in threaded view
|

mybatis3 <foreach> tag question

Emi Lu
In reply to this post by Emi Lu
Hello List,

A question about <foreach> tag.

JAVA code: String[] check_array_values


xml code:

  <if test="check_array_values != null and check_array_values.length>0 ">
  columnX::VARCHAR IN
       <foreach item="item" index="index" collection="check_array_values"
         open="(" separator="," close=")">
          #{item}
       </foreach>
</if>

I always got an error! Could someone tell me where I put wrong please?

. Does collection accept String[]?
. item = "item" is just a free name right?

Any grammar wrong?

Thank you,
Lu Ying

Reply | Threaded
Open this post in threaded view
|

Re: java.lang.NoClassDefFoundError: net/sf/cglib/proxy Error

Simone Tripodi
In reply to this post by Emi Lu
you're welcome :)
zai jihan!
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Thu, Dec 2, 2010 at 10:14 PM, Emi Lu <[hidden email]> wrote:

> Ni Hao!
>
>> please make suce the cglib.jar is in the classpath, it should fix that
>> issue; if you're using apache maven, add the following dependency:
>>
>>     <dependency>
>>       <groupId>cglib</groupId>
>>       <artifactId>cglib</artifactId>
>>       <version>2.1_3</version>
>>     </dependency>
>
> I added cglib.jar and asm.jar. It seems that fixes the problem.
>
> Thank you!
> Lu Ying
>
>
haq
Reply | Threaded
Open this post in threaded view
|

Re: "org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented." Problem

haq
In reply to this post by Guy Rouillier
I encountered the same problem. the exception causes my program to
stop. If postgres does not have a jdbc driver implementing this
method, how can I get around this problem with myBatis?

On Dec 2, 4:25 pm, Guy Rouillier <[hidden email]> wrote:

> On 12/2/2010 10:18 AM, Emi Lu wrote:
>
>
>
> >>> Does anyone know what may cause this problem?
>
> >>> org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is
> >>> not yet implemented.
>
> >> Error message seems pretty self-explanatory. You are calling a method
> >> that is not yet implemented. I see the following statement on the PgJDBC
> >> project pagehttp://jdbc.postgresql.org/download.html:
>
> >> "JDK 1.6 - JDBC4. Support for JDBC4 methods is limited. The driver
> >> builds, but the several of the new methods are stubbed out."
>
> >> Looks like you encountered one of the ones that is stubbed out.
>
> > Thank you for the answer Guy!
>
> > For JDK1.6, postgresql8.3, struts2, mybatis3, do you know how to fix
> > this problem?
>
> > Would "JDBC3 Postgresql Driver, Version 9.0-801" fixed the problem?
>
> Well, the site says to use the JDBC4 driver if you are using JDK 1.6.
> Does the message you identify cause your app to fail?  That message
> sounds like it is just informational; failure to set the query timeout
> should not be a critical failure.
>
> If this issue does stop your app from working, I'd suggest asking for
> help on the PostgreSQL forums.  This would be a driver issue and really
> outside of domain of MyBatis.
>
> --
> Guy Rouillier
Reply | Threaded
Open this post in threaded view
|

Re: "org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented." Problem

Guy Rouillier
On 12/27/2010 10:14 AM, haq wrote:
> I encountered the same problem. the exception causes my program to
> stop. If postgres does not have a jdbc driver implementing this
> method, how can I get around this problem with myBatis?

Would someone please provide some sample code that causes this error?  I
do not encounter it running the mybatis_contact_manager sample.

--
Guy Rouillier
Reply | Threaded
Open this post in threaded view
|

Re: "org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented." Problem

Larry Meadors
I've not had this happen either.

What driver are you using? I'm at 8.4-701 (according to maven).

Larry



On Mon, Dec 27, 2010 at 10:30 PM, Guy Rouillier <[hidden email]> wrote:

> On 12/27/2010 10:14 AM, haq wrote:
>>
>> I encountered the same problem. the exception causes my program to
>> stop. If postgres does not have a jdbc driver implementing this
>> method, how can I get around this problem with myBatis?
>
> Would someone please provide some sample code that causes this error?  I do
> not encounter it running the mybatis_contact_manager sample.
>
> --
> Guy Rouillier
>
haq
Reply | Threaded
Open this post in threaded view
|

Re: "org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented." Problem

haq
I am using postgresql-8.4-701.jdbc4.jar, with mybatis-3.0.4-SNAPSHOT.jar


Here is the partial junit test trace:

org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: org.postgresql.util.PSQLException: Method org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented.
### The error may exist in com/axiomainc/db/AssetMapper.xml
### The error may involve com.axiomainc.db.AssetMapper.insert
### The error occurred while executing an update
### SQL: insert into asset values (?, ?,  (select asset_type_id from asset_type  where asset_type.name_key = UPPER(?) ),    ?, ?)
### Cause: org.postgresql.util.PSQLException: Method org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented.
    at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:120)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:107)
    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:56)
    at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:35)
    at $Proxy5.insert(Unknown Source)

On Tue, Dec 28, 2010 at 10:14 AM, Larry Meadors <[hidden email]> wrote:
I've not had this happen either.

What driver are you using? I'm at 8.4-701 (according to maven).

Larry



On Mon, Dec 27, 2010 at 10:30 PM, Guy Rouillier <[hidden email]> wrote:
> On 12/27/2010 10:14 AM, haq wrote:
>>
>> I encountered the same problem. the exception causes my program to
>> stop. If postgres does not have a jdbc driver implementing this
>> method, how can I get around this problem with myBatis?
>
> Would someone please provide some sample code that causes this error?  I do
> not encounter it running the mybatis_contact_manager sample.
>
> --
> Guy Rouillier
>

Reply | Threaded
Open this post in threaded view
|

Re: "org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented." Problem

Nathan Maves
we are going to need to see more than that.  send us your configuration.

On Tue, Dec 28, 2010 at 8:38 AM, Andrew Qiu <[hidden email]> wrote:

> I am using postgresql-8.4-701.jdbc4.jar, with mybatis-3.0.4-SNAPSHOT.jar
>
>
> Here is the partial junit test trace:
>
> org.apache.ibatis.exceptions.PersistenceException:
> ### Error updating database.  Cause: org.postgresql.util.PSQLException:
> Method org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is
> not yet implemented.
> ### The error may exist in com/axiomainc/db/AssetMapper.xml
> ### The error may involve com.axiomainc.db.AssetMapper.insert
> ### The error occurred while executing an update
> ### SQL: insert into asset values (?, ?,  (select asset_type_id from
> asset_type  where asset_type.name_key = UPPER(?) ),    ?, ?)
> ### Cause: org.postgresql.util.PSQLException: Method
> org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet
> implemented.
>     at
> org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
>     at
> org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:120)
>     at
> org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:107)
>     at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:56)
>     at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:35)
>     at $Proxy5.insert(Unknown Source)
>
> On Tue, Dec 28, 2010 at 10:14 AM, Larry Meadors <[hidden email]>
> wrote:
>>
>> I've not had this happen either.
>>
>> What driver are you using? I'm at 8.4-701 (according to maven).
>>
>> Larry
>>
>>
>>
>> On Mon, Dec 27, 2010 at 10:30 PM, Guy Rouillier <[hidden email]>
>> wrote:
>> > On 12/27/2010 10:14 AM, haq wrote:
>> >>
>> >> I encountered the same problem. the exception causes my program to
>> >> stop. If postgres does not have a jdbc driver implementing this
>> >> method, how can I get around this problem with myBatis?
>> >
>> > Would someone please provide some sample code that causes this error?  I
>> > do
>> > not encounter it running the mybatis_contact_manager sample.
>> >
>> > --
>> > Guy Rouillier
>> >
>
>
Reply | Threaded
Open this post in threaded view
|

Re: "org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented." Problem

Larry Meadors
In reply to this post by haq
Are you setting a timeout on that statement?

On Tue, Dec 28, 2010 at 8:38 AM, Andrew Qiu <[hidden email]> wrote:

> I am using postgresql-8.4-701.jdbc4.jar, with mybatis-3.0.4-SNAPSHOT.jar
>
>
> Here is the partial junit test trace:
>
> org.apache.ibatis.exceptions.PersistenceException:
> ### Error updating database.  Cause: org.postgresql.util.PSQLException:
> Method org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is
> not yet implemented.
> ### The error may exist in com/axiomainc/db/AssetMapper.xml
> ### The error may involve com.axiomainc.db.AssetMapper.insert
> ### The error occurred while executing an update
> ### SQL: insert into asset values (?, ?,  (select asset_type_id from
> asset_type  where asset_type.name_key = UPPER(?) ),    ?, ?)
> ### Cause: org.postgresql.util.PSQLException: Method
> org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet
> implemented.
>     at
> org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
>     at
> org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:120)
>     at
> org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:107)
>     at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:56)
>     at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:35)
>     at $Proxy5.insert(Unknown Source)
>
> On Tue, Dec 28, 2010 at 10:14 AM, Larry Meadors <[hidden email]>
> wrote:
>>
>> I've not had this happen either.
>>
>> What driver are you using? I'm at 8.4-701 (according to maven).
>>
>> Larry
>>
>>
>>
>> On Mon, Dec 27, 2010 at 10:30 PM, Guy Rouillier <[hidden email]>
>> wrote:
>> > On 12/27/2010 10:14 AM, haq wrote:
>> >>
>> >> I encountered the same problem. the exception causes my program to
>> >> stop. If postgres does not have a jdbc driver implementing this
>> >> method, how can I get around this problem with myBatis?
>> >
>> > Would someone please provide some sample code that causes this error?  I
>> > do
>> > not encounter it running the mybatis_contact_manager sample.
>> >
>> > --
>> > Guy Rouillier
>> >
>
>
haq
Reply | Threaded
Open this post in threaded view
|

Re: "org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented." Problem

haq
I do not explicitly set the timeout, but here is what is from my configuration.xml:

<configuration>

  <settings>
    <setting name="cacheEnabled" value="true"/>
    <setting name="lazyLoadingEnabled" value="false"/>
    <setting name="multipleResultSetsEnabled" value="true"/>
    <setting name="useColumnLabel" value="true"/>
    <setting name="useGeneratedKeys" value="false"/>
    <setting name="defaultExecutorType" value="SIMPLE"/>
    <setting name="defaultStatementTimeout" value="25000"/>
  </settings>


could this be the reason?

On Tue, Dec 28, 2010 at 12:00 PM, Larry Meadors <[hidden email]> wrote:
Are you setting a timeout on that statement?

On Tue, Dec 28, 2010 at 8:38 AM, Andrew Qiu <[hidden email]> wrote:
> I am using postgresql-8.4-701.jdbc4.jar, with mybatis-3.0.4-SNAPSHOT.jar
>
>
> Here is the partial junit test trace:
>
> org.apache.ibatis.exceptions.PersistenceException:
> ### Error updating database.  Cause: org.postgresql.util.PSQLException:
> Method org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is
> not yet implemented.
> ### The error may exist in com/axiomainc/db/AssetMapper.xml
> ### The error may involve com.axiomainc.db.AssetMapper.insert
> ### The error occurred while executing an update
> ### SQL: insert into asset values (?, ?,  (select asset_type_id from
> asset_type  where asset_type.name_key = UPPER(?) ),    ?, ?)
> ### Cause: org.postgresql.util.PSQLException: Method
> org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet
> implemented.
>     at
> org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
>     at
> org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:120)
>     at
> org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:107)
>     at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:56)
>     at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:35)
>     at $Proxy5.insert(Unknown Source)
>
> On Tue, Dec 28, 2010 at 10:14 AM, Larry Meadors <[hidden email]>
> wrote:
>>
>> I've not had this happen either.
>>
>> What driver are you using? I'm at 8.4-701 (according to maven).
>>
>> Larry
>>
>>
>>
>> On Mon, Dec 27, 2010 at 10:30 PM, Guy Rouillier <[hidden email]>
>> wrote:
>> > On 12/27/2010 10:14 AM, haq wrote:
>> >>
>> >> I encountered the same problem. the exception causes my program to
>> >> stop. If postgres does not have a jdbc driver implementing this
>> >> method, how can I get around this problem with myBatis?
>> >
>> > Would someone please provide some sample code that causes this error?  I
>> > do
>> > not encounter it running the mybatis_contact_manager sample.
>> >
>> > --
>> > Guy Rouillier
>> >
>
>

Reply | Threaded
Open this post in threaded view
|

Re: "org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented." Problem

Richard Yee
Take out "<setting name="defaultStatementTimeout" value="25000"/>" and try it.

-Richard


On Tue, Dec 28, 2010 at 1:28 PM, Andrew Qiu <[hidden email]> wrote:
I do not explicitly set the timeout, but here is what is from my configuration.xml:

<configuration>

  <settings>
    <setting name="cacheEnabled" value="true"/>
    <setting name="lazyLoadingEnabled" value="false"/>
    <setting name="multipleResultSetsEnabled" value="true"/>
    <setting name="useColumnLabel" value="true"/>
    <setting name="useGeneratedKeys" value="false"/>
    <setting name="defaultExecutorType" value="SIMPLE"/>
    <setting name="defaultStatementTimeout" value="25000"/>
  </settings>


could this be the reason?


On Tue, Dec 28, 2010 at 12:00 PM, Larry Meadors <[hidden email]> wrote:
Are you setting a timeout on that statement?

On Tue, Dec 28, 2010 at 8:38 AM, Andrew Qiu <[hidden email]> wrote:
> I am using postgresql-8.4-701.jdbc4.jar, with mybatis-3.0.4-SNAPSHOT.jar
>
>
> Here is the partial junit test trace:
>
> org.apache.ibatis.exceptions.PersistenceException:
> ### Error updating database.  Cause: org.postgresql.util.PSQLException:
> Method org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is
> not yet implemented.
> ### The error may exist in com/axiomainc/db/AssetMapper.xml
> ### The error may involve com.axiomainc.db.AssetMapper.insert
> ### The error occurred while executing an update
> ### SQL: insert into asset values (?, ?,  (select asset_type_id from
> asset_type  where asset_type.name_key = UPPER(?) ),    ?, ?)
> ### Cause: org.postgresql.util.PSQLException: Method
> org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet
> implemented.
>     at
> org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
>     at
> org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:120)
>     at
> org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:107)
>     at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:56)
>     at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:35)
>     at $Proxy5.insert(Unknown Source)
>
> On Tue, Dec 28, 2010 at 10:14 AM, Larry Meadors <[hidden email]>
> wrote:
>>
>> I've not had this happen either.
>>
>> What driver are you using? I'm at 8.4-701 (according to maven).
>>
>> Larry
>>
>>
>>
>> On Mon, Dec 27, 2010 at 10:30 PM, Guy Rouillier <[hidden email]>
>> wrote:
>> > On 12/27/2010 10:14 AM, haq wrote:
>> >>
>> >> I encountered the same problem. the exception causes my program to
>> >> stop. If postgres does not have a jdbc driver implementing this
>> >> method, how can I get around this problem with myBatis?
>> >
>> > Would someone please provide some sample code that causes this error?  I
>> > do
>> > not encounter it running the mybatis_contact_manager sample.
>> >
>> > --
>> > Guy Rouillier
>> >
>
>


Reply | Threaded
Open this post in threaded view
|

Re: "org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented." Problem

Larry Meadors
In reply to this post by haq
Well, I'd remove <setting name="defaultStatementTimeout"
value="25000"/>, because your driver doesn't support it. :)

There's not really much we can do with mybatis to deal with this any better.

It's a driver issue, so changing the framework because a driver throws
an exception (inappropriately, IMO) seems like a bad idea.

Larry
haq
Reply | Threaded
Open this post in threaded view
|

Re: "org.postgresql.jdbc4.Jdbc4PreparedStatement.setQueryTimeout(int) is not yet implemented." Problem

haq
that worked! Thanks!

On Tue, Dec 28, 2010 at 5:12 PM, Larry Meadors <[hidden email]> wrote:
Well, I'd remove <setting name="defaultStatementTimeout"
value="25000"/>, because your driver doesn't support it. :)

There's not really much we can do with mybatis to deal with this any better.

It's a driver issue, so changing the framework because a driver throws
an exception (inappropriately, IMO) seems like a bad idea.

Larry