Let's say i have two tables in db: Car and Part. Car owns arbitrialy number of parts.
Because i use EJB 3.0 i have entity beans for Car and Part and Car entity bean contains list of Part objects.
I want to save new Part to db and right after that fetch from db all Cars. I exepect Part i've just added to be amongst parts associated with fetched Cars. But it is not.
I do persist and find in single transaction so that's the problem i guess. How can i save something to db and right after calling persist on entityManager fetch it from db?