Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 44752 invoked from network); 3 May 2010 12:53:19 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 May 2010 12:53:19 -0000 Received: (qmail 20725 invoked by uid 500); 3 May 2010 12:53:19 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 20712 invoked by uid 500); 3 May 2010 12:53:19 -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 20704 invoked by uid 99); 3 May 2010 12:53:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 May 2010 12:53:19 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of borut.bolcina@gmail.com designates 209.85.218.220 as permitted sender) Received: from [209.85.218.220] (HELO mail-bw0-f220.google.com) (209.85.218.220) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 May 2010 12:53:12 +0000 Received: by bwz20 with SMTP id 20so1229034bwz.12 for ; Mon, 03 May 2010 05:52:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=BP2zy8wYz9CHQH6g6eQyhBNbUpegz+z4UO9adNzz9Ys=; b=Nu+h7nI+5lh4kQrcELH/kglnxIy3nzSx6bnczusDoWoEKwNIYfi/ikTlViy91DstN9 Pm3Z9CDzeMVUWjauE0KUx28DCRmOe+KKPHdK/NkostrChHxfDWeIX7ZXYHR1/pXGbyZy grEZPELlrqR8+9VOdMQP3Dzk3gb+9vlsn5Ijw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=AC/j8Axk6L/2PsL/pz96Cx9f7xwz3y8xi4HJL2ofBQZbzvlmJWTPXT6Lf9ZaaOh8XY orBY0TivOr2z56D6acVSwIRE2ZLJyt5qvbgiyoP3mrNmaX+gkRX3iGpqNJ9c5oj0peIi 0LCKhRYRqYQIJa7szwpBntvCUwBRMqNcGB54k= MIME-Version: 1.0 Received: by 10.204.126.84 with SMTP id b20mr184266bks.61.1272891171946; Mon, 03 May 2010 05:52:51 -0700 (PDT) Received: by 10.204.71.72 with HTTP; Mon, 3 May 2010 05:52:51 -0700 (PDT) In-Reply-To: References: Date: Mon, 3 May 2010 14:52:51 +0200 Message-ID: Subject: Re: Old web application needs a second database From: =?UTF-8?Q?Borut_Bol=C4=8Dina?= To: user@cayenne.apache.org Content-Type: multipart/alternative; boundary=0016e6d7e84c243fd70485b01209 X-Virus-Checked: Checked by ClamAV on apache.org --0016e6d7e84c243fd70485b01209 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks, So, my-cayenne.xml can only include node B and not both nodes as this new functionality only needs access to database B. Is that correct? -Borut 2010/5/3 Andrus Adamchik > > On May 3, 2010, at 3:12 PM, Borut Bol=C4=8Dina wrote: > > There will be cayenne.xml (with node A) and >> my-cayenne.xml (with node A and B) on the classpath. Is that why? >> > > Yes. > > > I am not sure how to initialize. >> > > #1 is created implicitly when you call DataContext.createDataContext(). > That's the one returned from Configuration.getSharedConfiguration(). > > #2 you will have to create yourself and store somewhere. E.g. in a > ServletContext attribute. > > > DefaultConfiguration conf =3D new DefaultConfiguration("my-cayenne.xml"); > // store it for the app duration soemwhere > ... > > // later when you need a new context: > Configuration conf =3D .. // get it from ServletContext or from where you= put > it > return conf.getDomain().createDataContext(); > > Andrus --0016e6d7e84c243fd70485b01209--