Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 5717 invoked from network); 24 Aug 2006 23:10:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Aug 2006 23:10:55 -0000 Received: (qmail 77191 invoked by uid 500); 24 Aug 2006 23:10:52 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 77166 invoked by uid 500); 24 Aug 2006 23:10:52 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 77154 invoked by uid 99); 24 Aug 2006 23:10:51 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Aug 2006 16:10:51 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [199.237.51.194] (HELO green.rootmode.com) (199.237.51.194) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Aug 2006 16:10:50 -0700 X-ClientAddr: 68.171.62.46 Received: from [192.168.15.104] (68-171-62-46.vnnyca.adelphia.net [68.171.62.46]) by green.rootmode.com (8.12.10/8.12.10) with ESMTP id k7ONAL3C026713 for ; Thu, 24 Aug 2006 19:10:22 -0400 Mime-Version: 1.0 (Apple Message framework v752.2) In-Reply-To: <851F29E7-DC8A-452F-8634-6CF5B15BCC61@objectstyle.org> References: <93ACF16B-B5BF-4D29-9C70-48C9C7E6C2B5@yahoo.com> <851F29E7-DC8A-452F-8634-6CF5B15BCC61@objectstyle.org> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Dain Sundstrom Subject: Re: Some jpa questions Date: Thu, 24 Aug 2006 16:10:14 -0700 To: dev@geronimo.apache.org X-Mailer: Apple Mail (2.752.2) X-RootMode-MailScanner-Information: Please contact the ISP for more information X-RootMode-MailScanner: Found to be clean X-MailScanner-From: dain@iq80.com X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Aug 24, 2006, at 1:50 PM, Andrus Adamchik wrote: >> 2. What's supposed to happen when you try to use a CM tx scoped EM >> outside a JTA tx? Section 5.6.1 seems to imply we aren't supposed >> to just throw an exception, but section 5.9.1 seems to imply there >> is no provider EM in back of the CM EM to do any work without a >> JTA tx. Are we supposed to create and close a provider EM for >> each call outside a tx? > > Good question... I have no idea. From what I understand, yes. >> - How heavyweight are EntityManagers? > > I guess this could be implementation specific, but they are > lightweight in Cayenne, and I assume they are lightweight in other > providers as well. > >> Is it more efficient to create a new one or pool them? > > While the spec provides some leeway (see below), container with > pluggable provider has no way of knowing the best strategy. My vote > is to avoid pooling EntityManagers by default. +1 If it later becomes an issue we can introduce pooling. My guess is that most providers are pooling under the covers since the largest user group will be unmanaged servlets which don't do app level pooling. -dain