Return-Path: Delivered-To: apmail-incubator-cayenne-user-archive@locus.apache.org Received: (qmail 90843 invoked from network); 26 Oct 2006 07:32:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Oct 2006 07:32:08 -0000 Received: (qmail 34455 invoked by uid 500); 26 Oct 2006 07:32:13 -0000 Delivered-To: apmail-incubator-cayenne-user-archive@incubator.apache.org Received: (qmail 34397 invoked by uid 500); 26 Oct 2006 07:32:12 -0000 Mailing-List: contact cayenne-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cayenne-user@incubator.apache.org Delivered-To: mailing list cayenne-user@incubator.apache.org Received: (qmail 34366 invoked by uid 99); 26 Oct 2006 07:32:12 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Oct 2006 00:32:12 -0700 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of borut.bolcina@gmail.com designates 66.249.82.235 as permitted sender) Received: from [66.249.82.235] (HELO wx-out-0506.google.com) (66.249.82.235) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Oct 2006 00:32:00 -0700 Received: by wx-out-0506.google.com with SMTP id s13so361008wxc for ; Thu, 26 Oct 2006 00:31:40 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=MUvKZbxkaW1ywd6x+e5eb0inPOPjtemK0aWIvXDNCwE0FPGE5B/c8v5FrJXHZ9nu4+Npl7mWpB2RyheLGyuWCofFcHTFpQOo5RYWopy2A883s0R0OyxSSot+wePF1VGpxzKpCsoSRtVL0q8R85ttqk4y/Utx4CzlYoOd8wamct0= Received: by 10.70.125.2 with SMTP id x2mr2760011wxc; Thu, 26 Oct 2006 00:31:39 -0700 (PDT) Received: by 10.70.116.2 with HTTP; Thu, 26 Oct 2006 00:31:39 -0700 (PDT) Message-ID: Date: Thu, 26 Oct 2006 09:31:39 +0200 From: "=?UTF-8?Q?Borut_Bol=C4=8Dina?=" To: cayenne-user@incubator.apache.org Subject: Re: Shared cache In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_36840_7622515.1161847899750" References: X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_36840_7622515.1161847899750 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I am interested in this also. 2006/10/18, Marko : > > Hi, list! > > I have a problem setting up a shared cache between two JVMs. The changes > in the JVM A don't all get propagated to JVM B. Here's the code: > > JVM A: > > // The following doesn't trigger the remote snapshot event... > DataContext context = DataContext.createDataContext(); > Dbe001 e001 = (Dbe001)context.createAndRegisterNewObject( > Dbe001.class); > e001.setA002(777); > context.commitChanges(); > > // While this does... > SelectQuery query = new SelectQuery(Dbe001.class); > List artists = context.performQuery(query); > artists.get(0).setA002(237846); > context.commitChanges(); > > JVM B: > > SnapshotEventListener customListener = new > DCSnapshotEventListener(); > > DataDomain domain = Configuration.getSharedConfiguration() > .getDomain(); > > domain.getEventManager().addListener(customListener, > "snapshotsChanged", SnapshotEvent.class, > domain.getSharedSnapshotCache > ().getSnapshotEventSubject(), > domain.getSharedSnapshotCache()); > > System.in.read(); > > > class DCSnapshotEventListener > implements SnapshotEventListener > { > public void snapshotsChanged(SnapshotEvent event) > { > Map diff = event.getModifiedDiffs(); > System.err.println(diff); > } > } > > > The data object looks like this: > > public class _Dbe001 extends org.apache.cayenne.CayenneDataObject { > > public static final String A002_PROPERTY = "a002"; > > public static final String A001_PK_COLUMN = "a001"; > > public void setA002(Integer a002) { > writeProperty("a002", a002); > } > public Integer getA002() { > return (Integer)readProperty("a002"); > } > > > } > > > And the database entity is as follows: > > > > isPrimaryKey="true" > isMandatory="true"/> > > > dbEntityName="dbe001"> > db-attribute-path="a002"/> > > > > > The transport layer is JGroups with default settings. Any ideas? > > ------=_Part_36840_7622515.1161847899750--