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 EF836D969 for ; Thu, 16 May 2013 17:35:12 +0000 (UTC) Received: (qmail 85940 invoked by uid 500); 16 May 2013 17:35:12 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 85879 invoked by uid 500); 16 May 2013 17:35: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 85869 invoked by uid 99); 16 May 2013 17:35:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 May 2013 17:35:12 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.78.103.231] (HELO vorsha.objectstyle.org) (208.78.103.231) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 16 May 2013 17:35:07 +0000 Received: (qmail 2536 invoked from network); 16 May 2013 17:37:21 -0000 Received: from unknown (HELO ?IPv6:::1?) (127.0.0.1) by localhost with SMTP; 16 May 2013 17:37:21 -0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: Change data by an external process (non cayenne) From: Andrus Adamchik In-Reply-To: Date: Thu, 16 May 2013 20:34:45 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <776FEE07-9DEE-4C85-AF47-CACF478D89F9@objectstyle.org> References: To: user@cayenne.apache.org X-Mailer: Apple Mail (2.1503) X-Virus-Checked: Checked by ClamAV on apache.org Actually if cross-context events are in effect (which is the default), = invalidating an object from a given ObjectContext will automatically = invalidate it across peers.=20 I would still approach it via query cache and cache groups though. All = that is needed is that all contexts access those objects via a query = instead of storing a direct reference. Andrus On May 16, 2013, at 12:14 PM, Markus Reich = wrote: > :-) sorry, I try it more detailed >=20 > I have a multiuser Tomcat Webapp, the DB (Oracle) is also updated by = other > processes. A refresh is not enough to show the changed data, so my = idea is > to make a servlet, which invalidates certain DataObjects (mostly it's = just > one) of all thread binded contexts. > So when the user refreshes the UI and the data gets selected again, = the > changed values are shown. > So it would be enough to make object hollow. >=20 > Markus >=20 >=20 > 2013/5/16 Andrus Adamchik >=20 >> The question is too generic, so the answer is "yes" :) Could you = describe >> the scenario in a bit more detail? >>=20 >> Also does your interface needs to know when an object is invalidated = right >> at that moment or is it enough to make the object "hollow" so that it = is >> refetched lazily on next access? >>=20 >> Andrus >>=20 >> On May 16, 2013, at 7:52 AM, Markus Reich = >> wrote: >>> would it be possible to work with a servlet to invalidate certain >> objects? >>>=20 >>> Is there a way to get all ObjectStores of all Threads or is the only >>> solution to set the DataContext as attribute in the session? >>>=20 >>>=20 >>> 2013/5/15 Andrus Adamchik >>>=20 >>>> I'd use query.setCacheStrategy(..) / query.setCacheGroups(..) to = cache >> the >>>> results, and then define expiration time for a given set of cache = groups >>>> for whatever cache provider is in use (EhCache most likely, so this >> will go >>>> into ehcache.xml). >>>>=20 >>>> If you want real-time refresh, EhCache might be configured to = listen to >>>> cache group refresh events via JMS. Your external process would = send >> such >>>> events via ActiveMQ (that supports a bunch of command-line friendly >>>> protocols, not just JMS) whenever the data is changed. >>>>=20 >>>> Andrus >>>>=20 >>>>=20 >>>> On May 15, 2013, at 4:28 PM, Markus Reich = >>>> wrote: >>>>=20 >>>>> Hi, >>>>>=20 >>>>> is there really no better way than described here: >>>>> http://markmail.org/message/plnaj4zj4gxrt6hk >>>>>=20 >>>>> regards >>>>> Meex >>>>=20 >>>>=20 >>>=20 >>>=20 >>> -- >>> *Markus Reich* >>> Moosbach 28/2 >>> 6392 St. Jakob i.H. >>> www.markusreich.at / www.meeximum.at >>> markus.reich@markusreich.at >>=20 >>=20 >=20 >=20 > --=20 > *Markus Reich* > Moosbach 28/2 > 6392 St. Jakob i.H. > www.markusreich.at / www.meeximum.at > markus.reich@markusreich.at