Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 6C5B09FB329 for ; Mon, 12 Feb 2007 12:46:48 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 61508-07 for ; Mon, 12 Feb 2007 12:46:33 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.232]) by postgresql.org (Postfix) with ESMTP id AE4849FB2E9 for ; Mon, 12 Feb 2007 12:46:32 -0400 (AST) Received: by nz-out-0506.google.com with SMTP id i11so1748467nzh for ; Mon, 12 Feb 2007 08:46:31 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=P1WK9M3irx8/nv4oNUU5VNCTFT1wfFlT4xIlKcYfzdf6WN8e5a7nziKYkk7LF/rvjTLVJx3CwZInEF0R7iQmIBTmavOB2jj9kPM+4sYi90iF/J1VKO9GWPRLqbgzvXxT9iA9CGCglHk51XT3w5/pgPbsPlI52/R2HhKaPYFiuD0= Received: by 10.65.114.11 with SMTP id r11mr8348305qbm.1171298791331; Mon, 12 Feb 2007 08:46:31 -0800 (PST) Received: from ?172.24.32.17? ( [62.232.55.118]) by mx.google.com with ESMTP id f18sm7107083qba.2007.02.12.08.46.27; Mon, 12 Feb 2007 08:46:28 -0800 (PST) Message-ID: <45D099CF.9060007@enterprisedb.com> Date: Mon, 12 Feb 2007 16:46:07 +0000 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.8 (X11/20061116) MIME-Version: 1.0 To: Nicolas Vervelle CC: pgsql-jdbc@postgresql.org Subject: Re: Problem with loginTimeout References: <45D09285.4080503@steria.com> In-Reply-To: <45D09285.4080503@steria.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.034 tagged_above=0 required=5 tests=AWL, BAYES_50, SPF_PASS X-Spam-Level: X-Archive-Number: 200702/49 X-Sequence-Number: 16605 Nicolas Vervelle wrote: > Hi, > > I am new to this list, so hello everyone. > > I am having troubles with getConnection() and the loginTimeout property. > > I am working with a 7.4.2 server and I was also using the 7.4 jdbc > driver (build 215). Everything is under Red Hat RHEL 3, JDK 1.4.2. > My application is running under JBoss 3.2.6. > > With this version, there was no support for timeout when using > getConnection(), so sometimes it takes 3 minutes for getConnection() to > send an exception. I have to connect to 35 databases one after an other > so the delay is really too important (3 * 35 minutes = 1h45). > Looking at the mailing list archives, I saw posts concerning this > problem and the solution of calling getConnection() in a separate Thread > and dealing with the timeout (6 seconds) in the mail thread. > I implemented this fix, but stumbled into an other problem: when a first > getConnection() is still running, following getConnection() won't return > a connection until the first one is finished. This implies that once a > getConnection() timedout (the 6 seconds timeout), every other attempt to > use getConnection() will also time out (6 seconds) until the first > getConnection() will definitely fail (3 minutes). > I don't see how I can find a solution for this problem, anyone can help > me ? > > I tried updating to the latest JDBC driver (8.2 build 504), and the > problem seems to be fixed. > But then I am getting errors with my EJB Entities when trying to create > new instances : > Could not create entity > org.postgresql.util.PSQLException: ERROR: column "tab_alarme_emis_pcc" > is of type boolean but expression is of type character > The corresponding field is defined as : > - in the EJB entity: with > @ejb.persistence column-name="TAB_ALARME_EMIS_PCC" > public abstract Boolean getEmisPcc(); > - in the database: with tab_alarme_emis_pcc boolean It seems there's a problem in your EJB container or mapping etc. causing it to send booleans as CHARs instead. > What is the problem ? Please help. > Is there a global setting to have the pgdriver behaving as it was in 7.4 ? Try protocolVersion=2, see http://jdbc.postgresql.org/documentation/82/connect.html#connection-parameters -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com