If we have a web application which has
EntityManager directly in your DAOs. Be sure not to mark it as Extended and @Transactional - only on the service layer@Transactional(readOnly=true) in cases when there is only data retrievalOpenSessionInView and lazy collections. This is subjective, but in my opinion all objects that leave the service layer must be initialized. For small collections (for ex. list of roles) you can have eager collections. For bigger collections use HQL queries.