What is the differences when setup the TaskSessionSpringFactoryImpl using the following options?
(Option 1) taskSessionFactory.setEntityManager(taskSharedEntityManagerBean().getObject());
(Option 2) taskSessionFactory.setEntityManagerFactory(taskEmf());
What is the points in each case? Do they affect the scope of the underlying EntityManager used ? (ie when will the EntityManager closed)
PS : I use Spring 's java configuration instead of XML to define the spring bean , so taskEmf() represent a bean of the task 's emf and taskSharedEntityManagerBean() is a SharedEntityManagerBean factory bean that builds SharedEntityManager