Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 16014 invoked from network); 12 Nov 2010 18:03:08 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Nov 2010 18:03:08 -0000 Received: (qmail 89798 invoked by uid 500); 12 Nov 2010 18:03:39 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 89716 invoked by uid 500); 12 Nov 2010 18:03:39 -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 89707 invoked by uid 99); 12 Nov 2010 18:03:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Nov 2010 18:03:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Nov 2010 18:03:33 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oACI3DcK012685 for ; Fri, 12 Nov 2010 18:03:13 GMT Message-ID: <33533069.48621289584993262.JavaMail.jira@thor> Date: Fri, 12 Nov 2010 13:03:13 -0500 (EST) From: "Rick Curtis (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-1873) EntityManager#merge sometimes passes wrong entity values to @PostLoad EntityListeners In-Reply-To: <9907314.14821288900722145.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENJPA-1873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12931475#action_12931475 ] Rick Curtis commented on OPENJPA-1873: -------------------------------------- > Do we have someone representing the ASF on this JSR in the EG? Yes Kevin and Pinaki are both on the EG. I'll get one of them to comment on this issue early next week. > I'd rather like to get this confirmed before we implement it the wrong way. Agreed. > EntityManager#merge sometimes passes wrong entity values to @PostLoad EntityListeners > -------------------------------------------------------------------------------------- > > Key: OPENJPA-1873 > URL: https://issues.apache.org/jira/browse/OPENJPA-1873 > Project: OpenJPA > Issue Type: Bug > Components: kernel > Affects Versions: 2.0.0, 2.0.1, 2.0.2 > Reporter: Mark Struberg > Attachments: OPENJPA-1873-unittest.patch, postloadtest.zip > > > I've tested this with the latest from branches/2.0.x. > My entity has an @EntityListeners which observes the @PostLoad lifecycle event. This listener stores the 'old' values from the database for later use (see http://struberg.wordpress.com/2010/07/31/howto-changelog-with-jpa/ for the intention behind). All works well if the table has only a few rows. But if you add more rows, OpenJPA tries to optimize the access and only loads the @Version field + the dirty fields. In this case the merging seems to be wrong, because I get the NEW values from the dirty fields instead of the original values from the database passed to my @PostLoad method. > Did cost me a few grey hairs to track down the differences between the working and the broken scenarios here ;) But finally I was able to creat a unit test showing the problem -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.