hi all
I'm new in the hibernate technology.
Basically, as show below, I retrieve a list of rule from a database. I don't want to modify this list but just read it.
Code:
private ArrayList RetrieveRules(String dapAetitle) {
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
ArrayList result = (ArrayList) session.createQuery("from Rule").list();
//session.getTransaction().commit();
return result;
}
I had to comment the commit line because otherwise a error raised
(and tell me I can't use the result because the session was closed)
I simply want to detach the result variable and update it when the database changes.
I wonder if it's dangerous to not close a session by commiting the linked transaction
and how to detach my variable result