Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #33963
| Path | csiph.com!aioe.org!.POSTED!not-for-mail |
|---|---|
| From | Arne Vajhøj <arne@vajhoej.dk> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Troubles with informix jdbc driver ... |
| Date | Mon, 14 Mar 2016 18:16:55 -0400 |
| Organization | Aioe.org NNTP Server |
| Lines | 56 |
| Message-ID | <nc7d8t$oki$1@gioia.aioe.org> (permalink) |
| References | <slrnnedgqn.456.avl@login.logic.tuwien.ac.at> |
| NNTP-Posting-Host | ANasIS7Js9OyLQwgloeBLQ.user.gioia.aioe.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Complaints-To | abuse@aioe.org |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
| X-Notice | Filtered by postfilter v. 0.8.2 |
| Xref | csiph.com comp.lang.java.programmer:33963 |
Show key headers only | View raw
On 3/14/2016 9:54 AM, Andreas Leitgeb wrote:
> A previous version of Informix jdbc ("3.70.JC5DE") was very
> strict with "thread safety", in that it governed any connection
> to any db server with a global lock. If one DB server was
> temporarily unreachable, then it would block also connections
> to any other db server (attempted from other threads).
>
> Some newer version of their jdbc driver (4.10.JC5) seems to
> have that fixed, but we now observe that Connections obtained
> from calling DriverManager.getConnection(...) casually get
> mixed up! As a result, we observe threads retrieving data
> from wrong servers - not always, but "moderately reproducible".
>
> In my application the threads share little to no data, and there
> are definitely no static fields involved in my code related to
> the keeping of jdbc-related objects. I can't vouch for the
> driver, though.
>
> Has anyone else observed similar effects with Informix jdbc drivers
> and a bunch of independent threads opening connections to different
> db servers?
I have never seen such a problem before.
But let us investigate a bit.
So essentially you have
thread 1:
Connection cona = DriverManager.getConnection(constr2a);
thread 2:
Connection conb = DriverManager.getConnection(constr2b);
and sometimes you end up with the Connection object actually having
the connection to the wrong database (different connection string)?
As if there somewhere deep down in the driver code were a static field
being overwritten.
That would be easy to test by just putting:
synchronized(DriverManagager.class) {
}
around all the getConnection calls.
If that removes the problem, then I would say that it is clear that
the problem is in the driver code.
Arne
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Troubles with informix jdbc driver ... Andreas Leitgeb <avl@logic.at> - 2016-03-14 13:54 +0000
Re: Troubles with informix jdbc driver ... Marcel Mueller <news.5.maazl@spamgourmet.org> - 2016-03-14 21:23 +0100
Re: Troubles with informix jdbc driver ... Andreas Leitgeb <avl@logic.at> - 2016-03-14 21:30 +0000
Re: Troubles with informix jdbc driver ... Arne Vajhøj <arne@vajhoej.dk> - 2016-03-14 18:16 -0400
Re: Troubles with informix jdbc driver ... Marcel Mueller <news.5.maazl@spamgourmet.org> - 2016-03-15 21:57 +0100
Re: Troubles with informix jdbc driver ... Arne Vajhøj <arne@vajhoej.dk> - 2016-03-15 21:18 -0400
Re: Troubles with informix jdbc driver ... Andreas Leitgeb <avl@logic.at> - 2016-03-15 22:25 +0000
Re: Troubles with informix jdbc driver ... Arne Vajhøj <arne@vajhoej.dk> - 2016-03-15 21:25 -0400
Re: Troubles with informix jdbc driver ... Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2016-03-14 21:26 -0700
Re: Troubles with informix jdbc driver ... Andreas Leitgeb <avl@logic.at> - 2016-03-15 22:09 +0000
Re: Troubles with informix jdbc driver ... Andreas Leitgeb <avl@logic.at> - 2016-03-16 21:37 +0000
Re: Troubles with informix jdbc driver ... Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2016-03-16 22:36 -0700
Re: Troubles with informix jdbc driver ... -- workaround found Andreas Leitgeb <avl@logic.at> - 2016-03-17 17:23 +0000
Re: Troubles with informix jdbc driver ... -- workaround found Andreas Leitgeb <avl@logic.at> - 2016-03-18 11:13 +0000
csiph-web