I'm attempting to do a little task using Hibernate and JSF .
Here's my snippet of code . managed bean method that supposed to retrieve a list of tags :
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
public List<WikiTag> getTags(){
session.getTransaction().begin();
Criteria crit = session.createCriteria(WikiTag.class);
List<WikiTag> result = crit.list();
return result;
}
I understand that i can't have more than one session open. However when i call that snippet of code from a facelet i get
org.hibernate.TransactionException: nested transactions not supported
Any light thrown on this is much appreciated . thanks