Code:
hibernateUtil.get.......getCurrentSession.beginTransaction();
hibernateUtil.get.......getCurrentSession.getTransaction().commit();
hibernateUtil.get.......getCurrentSession.flush();
hibernateUtil.get.......getCurrentSession.close();
This is very repetitive code and it appears everywhere in the documentation in all possible forms. In some situations, combination A works, in other situation, you don't have to flush the session, in other situations, you HAVE to flush, but you don't have to close, in other..... and so on, and so on. Sometimes proxies have to be initialized, etc...
Now where exactly does this code belong?