Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 30836 invoked from network); 16 Feb 2011 09:51:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Feb 2011 09:51:11 -0000 Received: (qmail 1117 invoked by uid 500); 16 Feb 2011 09:51:11 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 918 invoked by uid 500); 16 Feb 2011 09:51:08 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 900 invoked by uid 99); 16 Feb 2011 09:51:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Feb 2011 09:51:06 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of grobmeier@gmail.com designates 209.85.214.171 as permitted sender) Received: from [209.85.214.171] (HELO mail-iw0-f171.google.com) (209.85.214.171) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Feb 2011 09:50:58 +0000 Received: by iwn2 with SMTP id 2so1139863iwn.16 for ; Wed, 16 Feb 2011 01:50:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=t4sr5iBnfxo4eDSUdNjZYGRZDsY7mVBoPdlE5Oa776E=; b=KGfUqX4KAx7OtUKeg97YM17vRSrjrfxMNX+yaK5rviBoKgexiJyWsc8mgXkAebcPGp M0VYfvONOj4HhYrHiQKS5NB5GEMaabpnoTls8OSyZPtqQzlO2zuixgg9fCNwYjSWQtCc 8ASpF5irKbVAdk7+7eaZcfsgb9+kQ0egY7UnM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=XrfAEmG7FakAAztWUNGRKl12DSt3EviBvsL3jHDHWTOhHwLL6bXA+DPUGL6l3mSaBk /FiV6vNnBIWbMD9r+0gRxhRwl5AyGawRYr4LrS9P56WHg2khMBhk8rrc2nX7IuRVtTqq e8IDYGSxaNyNdeBp3gvvIluuQO+acQ9M2Jrts= Received: by 10.42.166.136 with SMTP id o8mr470016icy.234.1297849837006; Wed, 16 Feb 2011 01:50:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.53.15 with HTTP; Wed, 16 Feb 2011 01:50:16 -0800 (PST) From: Christian Grobmeier Date: Wed, 16 Feb 2011 10:50:16 +0100 Message-ID: Subject: ObjectContext per thread or per app? To: user@cayenne.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org Hello, sorry, a dumb question: do I need a ObjectContext per thread or per app? In fact I wrote a spring bean (its a singleton) which creates one single ObjectContext for all my app. In other terms, multiple threads will use it to insert, read, commit etc. Since ObjectContext offers the commit method, I am now doubting if this was correct. I feel it might be good to have an ObjectContext for each thread/user. Or does the ObjectContext know what happened as one transaction? Can you advise? Thanks Christian -- http://www.grobmeier.de