Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 65715 invoked from network); 25 Aug 2009 11:36:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Aug 2009 11:36:20 -0000 Received: (qmail 2927 invoked by uid 500); 25 Aug 2009 11:36:44 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 2846 invoked by uid 500); 25 Aug 2009 11:36:43 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 2838 invoked by uid 99); 25 Aug 2009 11:36:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Aug 2009 11:36:43 +0000 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: domain of mwessendorf@gmail.com designates 209.85.219.221 as permitted sender) Received: from [209.85.219.221] (HELO mail-ew0-f221.google.com) (209.85.219.221) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Aug 2009 11:36:32 +0000 Received: by ewy21 with SMTP id 21so4416002ewy.21 for ; Tue, 25 Aug 2009 04:36:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=lGx1P8MzYw9fgkA8KI5cxPybXtLrJuXfLOsdIJLRBOo=; b=YGFUNtzFvX7aTFW+u6dx4b07ygPBFNUrKBVfNSdnS3IKawVAPEUHaXZi6SEBJqKs9P YIkolw8LKYExIHmRlAqr6baUEl58qnEzeif/bkU01oBSE4Se4yjTTfy+iTC5TwHy0YJ3 S+ZlNM1tTwcZY2QuiOkSDt8QojzsbGYmTYehs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=kcAZdr23/kAUfKipVxeI36uqDPNFgoXXh/gj1OPQdXZhOWByd1oaVb9Miq/+7yOwuH mgnFzO+UcIlzMJTvmP51Cu03j1x4qYwuBn80x7Zcjq4IeRPnBMnKpphlnhpdW3tRWmHz q0GDLIvSJ0du2qDzjr4/1vzKJzb0LdkOu9GvE= MIME-Version: 1.0 Sender: mwessendorf@gmail.com Received: by 10.210.140.18 with SMTP id n18mr6234727ebd.13.1251200171320; Tue, 25 Aug 2009 04:36:11 -0700 (PDT) In-Reply-To: References: Date: Tue, 25 Aug 2009 13:36:11 +0200 X-Google-Sender-Auth: a797b9afc3cf7b0b Message-ID: <71235db40908250436w36b092ffmcb2d98156630725e@mail.gmail.com> Subject: Re: [Trinidad] Ensure Correctness of Data. From: Matthias Wessendorf To: MyFaces Discussion Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Mon, Aug 24, 2009 at 6:07 PM, Leon Dorfling wrote: > We are developing our first Java project using Trinidad. > > > > We are trying to resolve, a seemingly simple problem we have encountered, > but due to our lack of experience have not found the optimal solution. > > > > Our problem is, 2 users are viewing the same data. User1 deletes a record > from the database. The deleted record has not yet been deleted from user2= =92s > page. Subsequentley user2 tries to update the record deleted by user1. Us= er2 > clicks on the record (deleted by user1) and navigates to a page to update > the record. The update page is rendered with data for the row after the > deleted row in the table. > > > > How do I ensure that if user2 tries to update a deleted record, he is eit= her > warned that the records no longer exists or the data is refreshed before = he > invokes an update process. you need to implement a smarter solution here by your self. EG using unique IDs, so that one could not load a deleted object by a (wrong) ID. Another would be to implement something like optimistic locking, see here: http://api.rubyonrails.org/classes/ActiveRecord/Locking/Optimistic.html (no, there is no need to use ActiveRecord for that. Can be done with anything you are using in the back-end). But basically your application (design) has to take care of this. -Matthias > > > > Thanks. > > > > Leon Dorfling > Pepkor IT > email : leond@pepkoritcom > tel : (021) 937 9225 > fax : (021) 937 9213 > cell : 083 6789 270 > > > > Pep a division of Pepkor Retail Limited.The legal status of this > communication is governed by the terms and conditions > published at http://www.pepstores.com/cms/view/content/email_disclaimer, > which terms and conditions relate,inter alia, to confidentiality and > limitation of liability and include the names of directors and the > registration number of the company. --=20 Matthias Wessendorf blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf twitter: http://twitter.com/mwessendorf