[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.rt.eclipselink] Cache Refresh Problem
|
Hello friends,
I have a bidirectiion one-2-many relationship between A and B.
A is the ONE side, and B is the MANY side.
Now I add an instance of B (say b) into database.
B b = new B();
b.setA(a); // suppose that I've already had an A instance.
session.persist(b); // surround this code I've opened a transaction
Outside this transaction, I open a new one then use
a.getBs(); // the same a in database
to fetch all related B, but I cannot get the set that contains the new added object b.
I also tested that, if I explicitly set a.getBs().add(b); then the result seems right.
But I'm wondering that, when I persist(b), all the relations have been saved in database, but it seems that the cache not refreshed, this case leads a.getBs() cannot get the new added b, because:
1. no database query performed
2. the cache has not been refreshed automatically or manually
So can anyone tell if this is a bug or the common behavior of EclipseLink? Because Hibernate may work OK without manually add b to a, because A is the master side.
Thank you for help!