That was the hint I needed. Thank you
My GlassFish domain had ojdbc14.jar in its lib
After replacing with ojdbc6.jar (which appears to be most appropriate for Oracle 11g with Java 1.6) the problem is solved.
Andy Knight
Principal Engineer,
Sun Microsystems, Inc.
Java House, Guillemont Park, Minley Road,
Camberley, Surrey GU17 9QG United Kingdom
Home office: +44 1494 462438
Mobile: +44 7775 583415
Skype: aprknight
Email: Andy.Knight_at_Sun.COM
Blog:
http://blogs.sun.com/andky
On 19 Jan 2010, at 10:50, Shalini Muthukrishnan wrote:
> Which version of oracle jdbc driver are you using? Also, what is the version of Java?
> isValid(timeout) was introduced in 1.6.
>
> Thanks,
> Shalini.
>
> Andy Knight wrote:
>> I am aware of the Connection Pool validation mechanism. That doesn't help me.
>>
>> I need to deal with this at the JDBC level. If I get an exception whilst carrying out any activity on the database in my application, I need a generic solution for determining whether the connection is still valid. If I know what type of database I'm connecting to, then I can take action accordingly (e.g. for Oracle "SELECT * FROM DUAL;").
>>
>> What we really need to understand is why java.lang.AbstractMethodError is being raised and, of course, find a solution.
>>
>> Andy Knight Principal Engineer, Sun Microsystems, Inc. Java House, Guillemont Park, Minley Road, Camberley, Surrey GU17 9QG United Kingdom Home office: +44 1494 462438 Mobile: +44 7775 583415 Skype: aprknight Email: Andy.Knight@Sun.COM Blog: http://blogs.sun.com/andky
>>
>> On 19 Jan 2010, at 07:46, Shalini Muthukrishnan wrote:
>>
>>
>>> Hi Andy,
>>>
>>> You could enable the Connection Validation for the JDBC Connection pool that is used. There are different validation mechanisms and when "table" is used as the validation method, a table name could be set to perform the connection validation.
>>>
>>> Please refer http://blogs.sun.com/JagadishPrasath/entry/connection_validation_in_glassfish_jdbc for more details on the same.
>>>
>>> Thanks,
>>> Shalini.
>>>
>>> Andy Knight wrote:
>>>
>>>> As far as I know (and please tell me if there's another way) the correct generic mechanism for testing the validity of a database connection is to use the /isValid() / method of /java.sql.Connection/
>>>> /
>>>> /
>>>> In this example, the underlying DB is Oracle and, of course, one could invoke "SELECT * FROM DUAL;" to test the connection. In fact, I believe that's what the GlassFish Connection Pool does by default for Oracle. However, in principle, I don't know that it's Oracle and so I need a generic technique.
>>>>
>>>> /If I acquire a connection from the GlassFish v2.1 Connection Pool and invoke /isValid()/, a rather unpleasant Exception occurs. Here's a Java code fragment that demonstrates the problem.../
>>>>
>>>> *Connection c = ((DataSource) new InitialContext().lookup("jdbc/myOracle")).getConnection();*
>>>> *c.isValid(10);*
>>>> /
>>>>
>>>> ...and here's the Exception...
>>>>
>>>> Caused by: java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.isValid(I)Z
>>>> at com.sun.gjc.spi.jdbc40.ConnectionHolder40.isValid(ConnectionHolder40.java:196)
>>>> at com.sun.fast.OracleBean.ConnectAndValidate(OracleBean.java:20)
>>>>
>>>> The class com.sun.gjc.spi.jdbc40.ConnectionHolder40 is obviously a subclass of java.sql.Connection and is, in fact, the type returned by *getConnection()*.
>>>>
>>>> According to the Javadocs for AbstractMethodError...
>>>>
>>>> Thrown when an application tries to call an abstract method. Normally, this error is caught by the compiler; this error can only occur at run time if the definition of some class has incompatibly changed since the currently executing method was last compiled.
>>>>
>>>> How can I work around this?
>>>>
>>>> /
>>>> <http://www.sun.com> Andy Knight
>>>> Principal Engineer,
>>>> Sun Microsystems, Inc.
>>>> Java House, Guillemont Park, Minley Road,
>>>> Camberley, Surrey GU17 9QG United Kingdom
>>>> Home office: +44 1494 462438
>>>> Mobile: +44 7775 583415
>>>> Skype: aprknight
>>>> Email: Andy.Knight_at_Sun.COM <mailto:Andy.Knight_at_Sun.COM>
>>>> Blog: http://blogs.sun.com/andky
>>>> <http://www.sun.com>
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>