[jboss-jira] [JBoss JIRA] (WFLY-8954) Wildfly 10 with eclipselink Onscucess observer gets stale entity

Nuno Godinho de Matos (JIRA) issues at jboss.org
Sat Jul 14 06:16:00 EDT 2018


    [ https://issues.jboss.org/browse/WFLY-8954?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13605175#comment-13605175 ] 

Nuno Godinho de Matos commented on WFLY-8954:
---------------------------------------------

HI,

All I can say, is that as far as I can see the issue is not resolved.
So we are keeping all of our local tunnings.

Since I did not have any computer setup anymore to work with wildfly source or eclipselink.
Today I have done the following experiment:

1. Have checked out wildfly source code on branch 10.x with the test 
org.jboss.as.test.compat.jpa.eclipselink.wildfly8954.WFLY8954BaseTest
This branch can be obtained from:
git remote -v
origin	https://github.com/99sono/wildfly.git (fetch)

2. My local machine looks as follows:
git branch
* WFLY-8954
  master

3. I have checked out eclipselink runtime 
git remote -v
origin	git://git.eclipse.org/gitroot/eclipselink/eclipselink.runtime.git

4. I have built the eclipselink runtime:
ant -f antbuild.xml build-eclipselink-jar


5. Since I mad sure I know what eclipselink library is getting used when running the failing on observes test by logging:
this.getClass().getResource("/org/eclipse/persistence/internal/sessions/EmptyRecord.class");

6. I copy pasted the most recent eclipselink.jar built using the master branch of eclipselink into the module folder of the wildfly using during runtime of the system test
I called this jar locally_built_eclipselink.jar 
And I modified the module.xml to point to the locally built eclipselink jar.

7. I edited the pom.xml of system test to disable the task that copies resources on the test module.
Otherwise my changes would be useless since the module.xml and the eclipselink.jar would both be crushed


8. Mvn clean install
The result is no altered:
testSimpleCreateAndLoadEntities(org.jboss.as.test.compat.jpa.eclipselink.wildfly8954.WFLY8954BaseTest)  Time elapsed: 2.457 sec  <<< FAILURE!
java.lang.AssertionError: The observer bug has been tected. The context is: 
 EVENT OBSERVED: SomeEntityChangeEvent [oldValue=Initial Address Value. , newValue=IncrementAddressNumber: 1 , someEntityId=10] 
lastProcessedEntityAddressBeforeExecutingRefresh: Initial Address Value.  lastProcessedEntityAddressAfterExecutingRefresh: IncrementAddressNumber: 1  
 NOTE: location of eclipselink is: jar:file:/Users/johndoe/Projects/git/wildfly/testsuite/compat/target/modules/org/eclipse/persistence/test/locally_built_eclipselink.jar!/org/eclipse/persistence/internal/sessions/EmptyRecord.class .
	at org.junit.Assert.fail(Assert.java:88)
	at org.jboss.as.test.compat.jpa.eclipselink.wildfly8954.WFLY8954BaseTest.testSimpleCreateAndLoadEntities(WFLY8954BaseTest.java:148)



You can see from the log above running the mvn clean install that the library I built locally of eclipselink does not bring any changes.
For this reason, I see no option but going forward wit the JIPIAPA change that was provided ina pull request and which is working very  well.


NOTE:
We are stil using wildfly 10.1.0.Final  for the time being.

I did not do the same experiment using a more recent version of wildfly, since the git branch do this test is well prepared for 10.1.0.Final, and if the fix would be done on the eclipselink code itself and not in the JIPIPA i see no reason why the fix to eclipselink should not be working here as well.

>From my point of view a developer integrating with eclipselink and wildfly, right now, has not alternative other than to patch 
jipijapa-eclipselink.jar

On his own.

Kindest regards




> Wildfly 10 with eclipselink Onscucess observer gets stale entity
> ----------------------------------------------------------------
>
>                 Key: WFLY-8954
>                 URL: https://issues.jboss.org/browse/WFLY-8954
>             Project: WildFly
>          Issue Type: Bug
>          Components: JPA / Hibernate
>    Affects Versions: 10.0.0.Final
>            Reporter: Nuno Godinho de Matos
>            Assignee: Scott Marlow
>
> Hi,
> In widlfly there seems to be an important issue concerning CDI events and observing these events during onsuccess. At least while using eclipselink.
> When using wildfly 10.0.0.Final together with eclipselink, if an application modifies an entity A, fires an event stating entity A has been modified, and an observer consumes this event during transaction success.
> Then the observer will be working with stale entities that do not reflect the modifications done to the entity.
> A sample application for this issue is available in:
> https://github.com/99sono/wildfly10-observe-on-success-stale-entity
> The widlfly configuration xml for the sample application, is available in the application itself, as can be seen in the readme documentation.
> Many thanks for taking a look.
> Kindest regards.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list