From dev-return-5318-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Tue Aug 07 17:28:33 2007
Return-Path:
Delivered-To: apmail-openjpa-dev-archive@www.apache.org
Received: (qmail 50798 invoked from network); 7 Aug 2007 17:28:26 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2)
by minotaur.apache.org with SMTP; 7 Aug 2007 17:28:26 -0000
Received: (qmail 90296 invoked by uid 500); 7 Aug 2007 17:28:22 -0000
Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org
Received: (qmail 90231 invoked by uid 500); 7 Aug 2007 17:28:22 -0000
Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm
Precedence: bulk
List-Help:
List-Unsubscribe:
List-Post:
List-Id:
Reply-To: dev@openjpa.apache.org
Delivered-To: mailing list dev@openjpa.apache.org
Received: (qmail 90196 invoked by uid 99); 7 Aug 2007 17:28:21 -0000
Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230)
by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Aug 2007 10:28:21 -0700
X-ASF-Spam-Status: No, hits=-100.0 required=10.0
tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4)
by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Aug 2007 17:28:15 +0000
Received: from brutus (localhost [127.0.0.1])
by brutus.apache.org (Postfix) with ESMTP id 60B217141E2
for ; Tue, 7 Aug 2007 10:27:59 -0700 (PDT)
Message-ID: <31557195.1186507679393.JavaMail.jira@brutus>
Date: Tue, 7 Aug 2007 10:27:59 -0700 (PDT)
From: "Patrick Linskey (JIRA)"
To: dev@openjpa.apache.org
Subject: [jira] Updated: (OPENJPA-38) Force field writes on update
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Virus-Checked: Checked by ClamAV on apache.org
[ https://issues.apache.org/jira/browse/OPENJPA-38?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Linskey updated OPENJPA-38:
-----------------------------------
Fix Version/s: (was: 1.0.0)
> Force field writes on update
> ----------------------------
>
> Key: OPENJPA-38
> URL: https://issues.apache.org/jira/browse/OPENJPA-38
> Project: OpenJPA
> Issue Type: New Feature
> Environment: All
> Reporter: David Ezzio
>
> JPA supports use cases where optimistic checking is not desired. The application need only avoid using a version field in the entity class.
> However, OpenJPA optimizes its writes on update to include only those fields that have changed. In cases, where optimistic checking is not used, OpenJPA does not currently provide a way to write out some or all of the non-dirty fields when writing an unchecked object with at least one dirty field. As a result, when a class of objects is not checked, the changes from multiple transactions are merged in the database.
> For example, consider the class FooBar which has no version field. It has three fields, id, mango and pommegranate. Assume there is a FooBar record that starts off as the tuple,
> .
> With the current behavior, it would be changed to the tuple,
>
> by the following transactional sequence:
> Tx A: tx.begin();
> Tx A: foobar = em.find(FooBar.class, 100);
> Tx B: tx.begin();
> Tx B: foobar = em.find(FooBar.class, 100);
> Tx A: foobar.mango = "SMALL";
> Tx B: foobar.pommegrante = "SMALL";
> Tx A: tx.commit();
> Tx B: tx.commit();
> Depending on the application's needs, this behavior might be acceptable, but it might not be. The desired behavior may be that the result should be one of the two following tuples.
> Either,
>
> which is expected when Tx B commits last as shown above.
> Or,
>
> if it happens that Tx A commits last.
> To effect this behavior, a new feature could be added to OpenJPA. The use of this feature would be triggered by a new, non-JPA annotation, perhaps called EasilyDirtied, which when applied to a persistent attribute, would instruct OpenJPA to write this attribute's value out on all updates to the object's state. This annotation would be subservient to the mappedBy attribute in relationship annotations. In other words, it has no effect if the annotaton is applied to the mappedBy side of a relationship.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.