Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 68507 invoked from network); 9 Jul 2009 13:08:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Jul 2009 13:08:50 -0000 Received: (qmail 52595 invoked by uid 500); 9 Jul 2009 13:08:53 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 52567 invoked by uid 500); 9 Jul 2009 13:08:53 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 52542 invoked by uid 99); 9 Jul 2009 13:08:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jul 2009 13:08:53 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [193.201.183.194] (HELO smtp4.huk-coburg.de) (193.201.183.194) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jul 2009 13:08:41 +0000 Received: from sscd0027.huk-coburg.de ([10.148.152.136]) by smtp4.huk-coburg.de with Microsoft SMTPSVC(6.0.3790.3959); Thu, 9 Jul 2009 15:08:21 +0200 Received: by sscd0027.huk-coburg.de (Postfix, from userid 8) id 27D11209976; Thu, 9 Jul 2009 15:07:53 +0200 (CEST) Received: from sscd0001.dmz.huk.de (sscd0001.dmz.huk.de [10.148.152.131]) by sscd0027.huk-coburg.de (Postfix) with ESMTP id 0D978209975 for ; Thu, 9 Jul 2009 15:07:53 +0200 (CEST) Received: from SMX00003.lan.huk-coburg.de (unverified) by sscd0001.dmz.huk.de (HUK-COBURG Mailrelay2) with ESMTP id for ; Thu, 9 Jul 2009 15:08:20 +0200 Received: from VMX00100.lan.huk-coburg.de ([10.130.66.152]) by SMX00003.lan.huk-coburg.de ([10.131.196.183]) with mapi; Thu, 9 Jul 2009 15:08:21 +0200 From: "Scherer, Annette" To: "'users@openjpa.apache.org'" Date: Thu, 9 Jul 2009 15:08:20 +0200 Subject: AW: Close database connection Thread-Topic: Close database connection Thread-Index: Acn/1pd66GsrUPFITuqDvj5/RwUVWQAvhUUQ Message-ID: References: <72c1350f0907080715w3a670d08l31f2928ba6844dcb@mail.gmail.com> In-Reply-To: <72c1350f0907080715w3a670d08l31f2928ba6844dcb@mail.gmail.com> Accept-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE MIME-Version: 1.0 Content-Language: de-DE Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-OriginalArrivalTime: 09 Jul 2009 13:08:21.0174 (UTC) FILETIME=[556C5D60:01CA0096] X-Virus-Checked: Checked by ClamAV on apache.org Hello Michael, Thank you for your tip. I think, I do not use em.close() after very each operation on DB Should I additionally configure the ConnectionRetainMode property in my per= sistence.xml (Suppose not, for on-demand is the default configuration for C= onnectionRetainMode) Actual version .... ...... Improved version .... .... Annette Scherer Abteilung Informatik HUK-COBURG Bahnhofsplatz 96444 Coburg Telefon 09561 96-1718 Telefax 09561 96-3671 E-Mail Annette.Scherer@HUK-COBURG.de Internet www.HUK.de =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D HUK-COBURG Haftpflicht-Unterst=FCtzungs-Kasse kraftfahrender Beamter Deutsc= hlands a. G. in Coburg Reg.-Gericht Coburg HRB 100; St.-Nr. 9212/101/00021 Sitz der Gesellschaft: Bahnhofsplatz, 96444 Coburg Vorsitzender des Aufsichtsrats: Werner Strohmayr. Vorstand: Dr. Wolfgang Weiler (Sprecher), Wolfgang Fla=DFhoff, Stefan Gronb= ach, Klaus-J=FCrgen Heitmann, Dr. Christian Hofer. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -----Urspr=FCngliche Nachricht----- Von: Michael Dick [mailto:michael.d.dick@gmail.com]=20 Gesendet: Mittwoch, 8. Juli 2009 16:15 An: users@openjpa.apache.org Betreff: Re: Cloese database connection Hi Annette, Are you using container managed EntityManagers, or application managed EMs? It *sounds* like you the EntityManager isn't being closed. To answer your specific question the connection is opened the first time yo= u interact with the database (ie execute a query, or persist an entity). When it's closed depends on the ConnectionRetainMode setting [1] (looks like you're using 'always'). [1] http://openjpa.apache.org/builds/1.2.1/apache-openjpa-1.2.1/docs/manual/man= ual.html#ref_guide_dbsetup_retain HTH -mike On Wed, Jul 8, 2009 at 8:12 AM, Scherer, Annette < Annette.Scherer@huk-coburg.de> wrote: > Hello, > > I am using OpenJPA with managed transactions and connections on an IBM > WebSphere Application Server. > > Extract from persistence.xml: > > > > Configuration WAS: > JDBC - datasources - non XA connection > > > When does a managed connection open and when does it close? > My problem is that many connections will be opened that are never closed > again. Even if I shut down the Server, the connections remain open. > > > Thank you for help > Annette Scherer > > > Abteilung Informatik > > >