Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Update JPQL does not invalidate Entity caches, bug?

When execute update JPQL query and then update entity, that also updated in
JQPL in one transaction
Looks like a found a bug in EclipseLink:

Actions to perform
1. First transaction:
 * Execute JPQL Update query;
               
entityManager.createNamedQuery(Field.UNSET_POSITION_ALL).executeUpdate();

 * Find Entry that updated by query and update field of this entry;
                Field field = entityManager.find(Field.class, 2);
                field.setPosition(2);

2. Second transaction:
 * Find Entry updated after find and print value of updated field;
                Field field = entityManager.find(Field.class, 2);
                System.out.println("Field position: " +
field.getPosition());


First run will be without problems, but on second run I will field value set
by JPQL update instead of value updated on managed entity.

I've created a test project to demonstrate EclipseLink bug 
eclipselink-update-jpql@github
<https://github.com/ragesteel/eclipselink-update-jpql>  .

Tested on EclipseLink 2.4.2, 2.5.0, 2.5.1, 2.5.2 - problem exist.
When i tested on other JPA implementations - Hibernate, OpenJPA, DataNucleos
- all works as expected.

I've googled for EclipseLink Update JPQL Invalidate Cache but not found any
simulair problems.



--
View this message in context: http://eclipse.1072660.n5.nabble.com/Update-JPQL-does-not-invalidate-Entity-caches-bug-tp171573.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.


Back to the top