I'm having an issue eager loading a nested map. I've attached @ManyToMany(fetch=FetchType.EAGER) attributes to no avail. If the map is viewed in the debugger or force iterated in the code it loads ok.
The attached code attempts to replicate the scenario. Its not an exact match but is the best I could come up with without replicating the whole system.
The test creates an object, persists it to a db and re-loads it. The EntityManager is closed before accesing any fields. Finally the nested map is accessed and printed to screen.
On the first run of the test everything works as expected - the map is loaded and its contents are printed.
On the second run (without deleting or clearing the database) the map is empty. Looking at the database through objectdb explorer shows the map contents have saved ok.
If you could help me understand what is happening it'd be much appreciated!