title: Exception happen on get session from EntityManager after commit and close before session
body: <p>Get instance for EntityManager by below annotation config in Dao class. Used Dao class in a Rest API as bellow. when call save dao method first time, new UserEntity('name-1', 'password-1') save in database, but when call second save method(userDao.save(new UserEntity('name-2', 'password-2'))), happend exception by message "java.lang.IllegalStateException: Session/EntityManager is closed".</p>
  
  <pre><code>public class REST {
      @Autowire
      DaoUser userDao;
  
      public void save(){
           userDao.save(new UserEntity('name-1', 'password-1'));
           userDao.save(new UserEntity('name-2', 'password-2'));
      }
  }
  
   class UserDao {
        @PersistenceContext(
          name = "stadto",
          type = PersistenceContextType.TRANSACTION
         )
        private EntityManager manager;
  
        public void save(UserEntity user){
           Session session = manager.unwrap(Session.class);
           Transaction transaction = session.getTransaction();
           transaction.beginTransaction();
           session.save(user);
           transaction.commit();
           session.close();
        }
   }
  </code></pre>