Kiedy używać EntityManager.clear ()?
Niestandardowa klasa mapowania JPA ma metodę:
removeUser()
1. execute 'DELETE' HQL query to remove user
2. call getEntityManager().flush();
3. call getEntityManager().clear();
Jeśli poprawnie zrozumiem clear (), usunie z kontekstu wszystkie trwałe elementy.-źródło
Czytałem jednak takżetutaj,
you should define clear architecture- and design guidelines about where a
clear() can be called.
Jakie są jasne wskazówki, kiedy dzwonić wyczyść ()?