Hi, thanks very much for your helpful software. The problem is the storage of collection or map types is not stable, we lost them sometimes after JVM restarted. Eager fetch is properly set.And we still found that the storage is stable when we not use generic, such as "private List users = new ArrayList();" instead of "private List<User> users = new ArrayList<User>();".
The code about entity and fetch is:
@Entity public class Game { ....... @ElementCollection(fetch=FetchType.EAGER) private List<Player> members = new ArrayList<Player>(); ....... } @Embeddable public class Player { ...... } public class GameDAO { ...... public Game getGame(long id) { EntityManager em = emf.createEntityManager(); try { TypedQuery<Game> query = em.createQuery("select k from Game k where k.id=:id", Game.class); List<Game> result = query.setParameter("id", id).getResultList(); if(result.size() > 0) { Game g = result.get(0); return g; } } finally { em.close(); } return null; } ...... }