Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 378 invoked from network); 25 Jun 2008 13:27:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jun 2008 13:27:32 -0000 Received: (qmail 93530 invoked by uid 500); 25 Jun 2008 13:27:31 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 93472 invoked by uid 500); 25 Jun 2008 13:27:31 -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 93290 invoked by uid 99); 25 Jun 2008 13:27:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jun 2008 06:27:30 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.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; Wed, 25 Jun 2008 13:26:40 +0000 Received: (qmail 4928 invoked from network); 25 Jun 2008 13:26:59 -0000 Received: from unknown (HELO ?IPv6:::1?) (127.0.0.1) by localhost with SMTP; 25 Jun 2008 13:26:59 -0000 Message-Id: <57429FB9-5D81-4CFD-ACB6-E9752072E80C@objectstyle.org> From: Andrus Adamchik To: user@cayenne.apache.org In-Reply-To: <3219fff70806240337m561c9597v1a56afae0af10070@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v924) Subject: Re: RefreshQuery not supports insert/delete? Date: Wed, 25 Jun 2008 16:26:57 +0300 References: <3219fff70806240337m561c9597v1a56afae0af10070@mail.gmail.com> X-Mailer: Apple Mail (2.924) X-Virus-Checked: Checked by ClamAV on apache.org This is a bug. Let me see if there is a quick fix. https://issues.apache.org/cayenne/browse/CAY-1082 Andrus On Jun 24, 2008, at 1:37 PM, Andrey Razumovsky wrote: > Hi! > > > I can't figure out how to make the refreshing query work with > inserting or > deleting rows in database. For instance: > > > Artist a = ... > > assert a.getPaintingsArray().size() == 0; > > > //here is direct insert into database a painting of artist a > (artistid=a.id > ) > > > RefreshQuery refresher = new RefreshQuery(); > > context.performGenericQuery(refresher); > > > assert a.getPaintingsArray().size() == 1; //that's false > > > > Everything works perfect when I sql-update in database. When i sql- > delete, > i do also get an exception like this: > > org.apache.cayenne.FaultFailureException: [v.3.0M4 May 18 2008 > 16:32:02] > Error resolving fault, no matching row exists in the database for > ObjectId: > > > at org.apache.cayenne.BaseContext.prepareForAccess(BaseContext.java: > 100) > > at com.nic.rainbow.data.auto._Apkforecast.getDate(_Apkforecast.java: > 29) > > ...and so on > > when i try to iterate through related array > > > I'm using ROP if that helps. By the way, when i restart client, the > data > becomes correct, so i assume everything has changed correctly on a > server. > > If that's not supported, can you give me some advice to manually > refresh the > desired relationships? > > > Thanks, > > Andrey