Obviouly is not the way because it does'nt work. I get an Exception
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: entities.Country.organizations, no session or session was closed
Any idea of what to do?
you have to use the entity returned from merge:
public Country RefreshCountryCollection(Country country)
country = em.merge(country);
One thing I discovered is if you override the toString() method and output the relationships, it'll force the container to load the relationship related fields. I'm thinking it accomplishes the same thing as fetchtype.eager but i've had more luck with this. Plus it works dual fold since I use the toString() method in conjunction with facesMessages to display what the object coming back is.