ConnectionImpl.isValid() does not behave as described in Connection javadocs

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

ConnectionImpl.isValid() does not behave as described in Connection javadocs

Nick Vercammen
Hello,

I'm trying to write a solr driver for metabase. Internally metabase uses a
C3P0 connection pool. Upon checkout of the connection from the pool the
library does a call to isValid(0) (timeout = 0)

According to the javadocs (
https://docs.oracle.com/en/java/javase/11/docs/api/java.sql/java/sql/Connection.html#isValid(int))
a
timeout = 0 means no timeout. In the current implementation a timeout = 0
means that the connection is always invalid.

I can provide a PR for this.

Nick

--
[image: Zeticon]
Nick Vercammen
CTO
+32 9 275 31 31
+32 471 39 77 36
[hidden email]
<https://www.facebook.com/MediaHaven-1536452166583533/>
<https://www.linkedin.com/company/zeticon/> <https://twitter.com/mediahaven>
www.zeticon.com
Reply | Threaded
Open this post in threaded view
|

Re: ConnectionImpl.isValid() does not behave as described in Connection javadocs

Erick Erickson
Is this a Solr issue?

On Sun, Jan 19, 2020, 14:24 Nick Vercammen <[hidden email]>
wrote:

> Hello,
>
> I'm trying to write a solr driver for metabase. Internally metabase uses a
> C3P0 connection pool. Upon checkout of the connection from the pool the
> library does a call to isValid(0) (timeout = 0)
>
> According to the javadocs (
>
> https://docs.oracle.com/en/java/javase/11/docs/api/java.sql/java/sql/Connection.html#isValid(int)
> )
> a
> timeout = 0 means no timeout. In the current implementation a timeout = 0
> means that the connection is always invalid.
>
> I can provide a PR for this.
>
> Nick
>
> --
> [image: Zeticon]
> Nick Vercammen
> CTO
> +32 9 275 31 31
> +32 471 39 77 36
> [hidden email]
> <https://www.facebook.com/MediaHaven-1536452166583533/>
> <https://www.linkedin.com/company/zeticon/> <
> https://twitter.com/mediahaven>
> www.zeticon.com
>
Reply | Threaded
Open this post in threaded view
|

Re: ConnectionImpl.isValid() does not behave as described in Connection javadocs

Nick Vercammen
I think so as the ConnectionImpl in solr is not in line with the description of the java connection interface

> Op 19 jan. 2020 om 21:23 heeft Erick Erickson <[hidden email]> het volgende geschreven:
>
> Is this a Solr issue?
>
>> On Sun, Jan 19, 2020, 14:24 Nick Vercammen <[hidden email]>
>> wrote:
>>
>> Hello,
>>
>> I'm trying to write a solr driver for metabase. Internally metabase uses a
>> C3P0 connection pool. Upon checkout of the connection from the pool the
>> library does a call to isValid(0) (timeout = 0)
>>
>> According to the javadocs (
>>
>> https://docs.oracle.com/en/java/javase/11/docs/api/java.sql/java/sql/Connection.html#isValid(int)
>> )
>> a
>> timeout = 0 means no timeout. In the current implementation a timeout = 0
>> means that the connection is always invalid.
>>
>> I can provide a PR for this.
>>
>> Nick
>>
>> --
>> [image: Zeticon]
>> Nick Vercammen
>> CTO
>> +32 9 275 31 31
>> +32 471 39 77 36
>> [hidden email]
>> <https://www.facebook.com/MediaHaven-1536452166583533/>
>> <https://www.linkedin.com/company/zeticon/> <
>> https://twitter.com/mediahaven>
>> www.zeticon.com
>>
Reply | Threaded
Open this post in threaded view
|

Re: ConnectionImpl.isValid() does not behave as described in Connection javadocs

Kevin Risden-3
Nick - Feel free to open a Jira and PR. I think the disconnect is the
meaning of timeout=0 between JDBC and the Solr client.

Kevin Risden


On Sun, Jan 19, 2020 at 3:34 PM Nick Vercammen <[hidden email]>
wrote:

> I think so as the ConnectionImpl in solr is not in line with the
> description of the java connection interface
>
> > Op 19 jan. 2020 om 21:23 heeft Erick Erickson <[hidden email]>
> het volgende geschreven:
> >
> > Is this a Solr issue?
> >
> >> On Sun, Jan 19, 2020, 14:24 Nick Vercammen <[hidden email]>
> >> wrote:
> >>
> >> Hello,
> >>
> >> I'm trying to write a solr driver for metabase. Internally metabase
> uses a
> >> C3P0 connection pool. Upon checkout of the connection from the pool the
> >> library does a call to isValid(0) (timeout = 0)
> >>
> >> According to the javadocs (
> >>
> >>
> https://docs.oracle.com/en/java/javase/11/docs/api/java.sql/java/sql/Connection.html#isValid(int)
> >> )
> >> a
> >> timeout = 0 means no timeout. In the current implementation a timeout =
> 0
> >> means that the connection is always invalid.
> >>
> >> I can provide a PR for this.
> >>
> >> Nick
> >>
> >> --
> >> [image: Zeticon]
> >> Nick Vercammen
> >> CTO
> >> +32 9 275 31 31
> >> +32 471 39 77 36
> >> [hidden email]
> >> <https://www.facebook.com/MediaHaven-1536452166583533/>
> >> <https://www.linkedin.com/company/zeticon/> <
> >> https://twitter.com/mediahaven>
> >> www.zeticon.com
> >>
>