X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id D32CE11F657E for ; Wed, 12 Apr 2006 00:50:11 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -0.975 X-Spam-Level: X-Spam-Status: No, score=-0.975 required=5 tests=[BAYES_05=-1.11, FORGED_RCVD_HELO=0.135] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id Hz8+RTTmF9b4 for ; Wed, 12 Apr 2006 00:50:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from h90152.serverkompetenz.net (webandmailserver.com [81.169.173.201]) by postgresql.org (Postfix) with ESMTP id 8637F11F653D for ; Wed, 12 Apr 2006 00:50:04 -0300 (ADT) Received: from h90152.serverkompetenz.net (localhost [127.0.0.1]) by h90152.serverkompetenz.net (Postfix) with ESMTP id F08621E8D68 for ; Wed, 12 Apr 2006 05:50:02 +0200 (CEST) Received: from pcmar02 (p54A7718C.dip.t-dialin.net [84.167.113.140]) by h90152.serverkompetenz.net (Postfix) with ESMTP id B085A1E8D3F for ; Wed, 12 Apr 2006 05:50:00 +0200 (CEST) From: "Markus Riehl" To: Subject: Re: No automatic reconnect after network error Date: Wed, 12 Apr 2006 05:50:00 +0200 Message-ID: <000f01c65de4$2cd8a500$15b2a8c0@pcmar02> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 In-Reply-To: <443A7F7A.6090509@logix-tt.com> Importance: Normal X-Virus-Scanned: ClamAV using ClamSMTP X-Archive-Number: 200604/89 X-Sequence-Number: 15023 Hi Markus, thanks for your answer. > Currently, the backend cannot keep the current transaction if the > connection breaks, so it will be rolled back. That's ok, I just want the JDBC driver to reconnect as soon as the connection is available again. > At least JBoss, you can use the following approach: In the Datasource > definition, put the following: >=20 > > > boo > = jdbc:postgresql://localhost:5432/bar > [ ... other attributes ... ] > SELECT version() > SELECT > version() > > >=20 > This validates the connection before it is handed out on the > application, and throws away invalid connections. Be aware that the = SQL > is case sensitive, we had a problem with earlier versions of = OpenMDX/CRX > that had upper case letters in the tags so they were ignored by jboss. I'm using Resin, not JBoss. The above configuration means a lot of = overhead, just to verify that a connection is still valid. Is this the recommended = way in a production environment? I think this means that the PostgreSQL JDBC driver doesn't support = automatic reconnection. And I don't see this feature on the Roadmap. Is it unusual = to use PostgreSQL in a multi server environment? Without this feature I don't think PostgreSQL is the right choice for me = and I keep using SAPDB. I could implement it in my server application, but within the servlet engine it is almost impossible to do outside the JDBC driver. Thanks, Markus