Btw, I just recognised that 
mvn clean install -Dmaven.test.skip=true is now working because the 
openjpa-maven-plugin still tries to test enhance the classes (which are not 
there in this case). I will fix this tonight (or tomorrow) and deploy a fresh 
snapshot to the codehaus repo.

LieGrue,
strub

--- On Tue, 11/9/10, Mark Struberg (JIRA) <j...@apache.org> wrote:

> From: Mark Struberg (JIRA) <j...@apache.org>
> Subject: [jira] Updated: (OPENJPA-1873) EntityManager#merge sometimes passes 
> wrong entity values to @PostLoad EntityListeners
> To: dev@openjpa.apache.org
> Date: Tuesday, November 9, 2010, 4:33 PM
> 
>      [ 
> https://issues.apache.org/jira/browse/OPENJPA-1873?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
> ]
> 
> Mark Struberg updated OPENJPA-1873:
> -----------------------------------
> 
>     Attachment: postloadtest.zip
> 
> Hi! Just verified that @PostLoad gets fired in Hibernate.
> See the attached little maven project.
> 
> > 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.
> 
> 



Reply via email to