Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Cache issue with EclipseLink?

The testing scenarion is following. I have TripLocalInfo in
@ManyToOne(optional=false, cascade=CascadeType.PERSIST) to TripGeneralInfo
@OneToMany(mappedBy="generalInfo", cascade=CascadeType.ALL).


I have one junit test method in which I create a new TripLocalInfo and
related TripGeneralInfo info in one transaction, then remove tripLocalInfo
in second transaction.

In the second junit test I find the TripGeneralInfo instance,  create two
related TripLocalInfo and store them. 
The assertEquals("Two triplocalizedinfo must be saved",
2,tripGeneralInfo.getLocalizedInfo().size()); 
sometimes fails, because an extra TripLocalInfo instance was fetched
including extra TripLocalInfo which should be removed in last transaction,
so the  getLocalizedInfo().size() sometimes returns 3.

What I wonder, that if I look to db tables - everthing is OK there. Just two
rows are stored even if the java list size was 3.


-- 
View this message in context: http://old.nabble.com/Cache-issue-with-EclipseLink--tp22440339p28949525.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top