Hibernate active transaction
问题 In my service class I would like to have something like: class ClientService { // Authorize // Returns true: Authorization successful // Returns false: Authorization failed public boolean authorize(String id, String password) { //Here I would like to check if an active transaction exists. //If it exists, use that one, else create a new session and start //a new transaction. //For example: Session session = HibernateUtil.getSessionFactory().getCurrentSession(); if(!session.SOMEMETHOD_CHECK_IF