Return-Path: X-Original-To: apmail-cayenne-user-archive@www.apache.org Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E6EEC101A1 for ; Fri, 27 Sep 2013 15:47:12 +0000 (UTC) Received: (qmail 17861 invoked by uid 500); 27 Sep 2013 15:47:12 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 17614 invoked by uid 500); 27 Sep 2013 15:47:12 -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 17603 invoked by uid 99); 27 Sep 2013 15:47:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Sep 2013 15:47:12 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mkienenb@gmail.com designates 74.125.82.45 as permitted sender) Received: from [74.125.82.45] (HELO mail-wg0-f45.google.com) (74.125.82.45) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Sep 2013 15:47:06 +0000 Received: by mail-wg0-f45.google.com with SMTP id y10so2933187wgg.12 for ; Fri, 27 Sep 2013 08:46:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=Oy51ht95MI1GQgmz31YDCf8rUwvs47fjsJ8dp9yJEdE=; b=PawdqtsDgZXNGNs62t4pDZQXW52uR3hNpQ4aLmmx/Dg0OUOcu6tkGH95FkGP7QtkA8 Ic1izkCXqw7IMamcvBRjadqHggGCMoQaa+UBuEkjbvuoIYLoabQZsHxyvFnPssT+2uYd wTOFfa5D0ZMkiTUyPRvGhdzu0tDC1pXvhd877KziCPX6shnm206PcfYojwkjQIlzhk1W h1xUJwQ+bnDWtNgsivpl2Hx9xghHDZz49G1b32PYrqR7QiYLiKTPbZO0D74ZXJA0xsc3 oR3JfOC06X5wAHAakN7aBu42efDKLFqOIFR9Weh/VeD69G1vXnwONIMGVNWe8u7EnmhH /KGQ== X-Received: by 10.180.73.134 with SMTP id l6mr3234424wiv.16.1380296806223; Fri, 27 Sep 2013 08:46:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.213.8 with HTTP; Fri, 27 Sep 2013 08:46:26 -0700 (PDT) From: Mike Kienenberger Date: Fri, 27 Sep 2013 11:46:26 -0400 Message-ID: Subject: Creating a new ServerRuntime from an existing ServerRuntime To: user@cayenne.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org The idea of creating a new ServerRuntime is good, but the implementation leaves me with a few questions. My ServerRuntime is created in the context of the web app. Is it reasonable to try to create it using the information in the existing ServerRuntime? Can I pull the injector and modules out of the existing Runtime and reuse them to create a new runtime, or do I need to create copies of the existing modules and injector? My guess is that each runtime needs unique injector and modules objects, but I want to minimize the work I need to do. It looks like I have to pull my configurationLocation out of the ServerModule, which doesn't really provide it. I'm not seeing an easy way to create a new ServerRuntime from scratch without having access to data which was only available back when the web application started up, short of storing that information somewhere globally and reusing it. On Tue, Sep 24, 2013 at 2:04 PM, Andrus Adamchik w= rote: >> The "special DataContext" case where the qualifier should be ignored can= probably be handled by starting a separate ServerRuntime, where you can st= rip off the qualifiers. For whatever overhead it creates (ideally not much)= , this has an advantage of cleanly separating "spaces" with different ORM r= ules. > > Elaborating on this a bit=85 The old Configuration allowed multiple DataD= omains, each of those requiring its own DataMap(s) saved in the project upf= ront. Good idea, but hard to use in practice. > > ServerRuntime (with single DD each) is more user-friendly. By starting mu= ltiple independent runtimes you to easily reuse a single mapping project, t= weaking each in-memory copy local to each Runtime (as well as tweaking othe= r parameters like cache). 2 Runtimes can reuse a single DataSource (JNDI, o= r otherwise), etc. > > Andrus >