HibernateSession « Core « JPA Q&A





1. HibernateSession.open() and close() in nested SessionBeans    forum.hibernate.org

Hi, we are using Hibernate 2.1.2 with JBoss 3.2.1. The project uses EntityBeans as persistence layer. For some new functions we want to use Hibernate. How we use it: The client (other SessionBean, Servlet, JUnitEJB Test) calls a method on a stateless facade-SessionBean. This facade works with stateful SessionBeans (Session for EntityBeans) and/or with hibernate objects and may also call other ...

2. difference between HibernateSession and Http Session    forum.hibernate.org

Sorry but anthony is correct. A lot of bugs are due to poor Application design. Closing a hibernate session will not close a HttpSession. But you can do that if you wish. You should have a Session bean that implements HttpSessionBindingListener. Also this bean must have a method called valueUnbound(HttpSessionBindingEvent event) in which you can close your hibernate session. This method ...

3. HibernateSession HowToUseWith HttpSessions    forum.hibernate.org

Hibernate version: 2.1.6 Tomcat version: 4.1 Browser for testing: Mozilla Firefox 1.0.4 Hi all! I'm using JSF with Hibernate persistence. My application uses JavaBeans to compute the business logic and Hibernate sessions to store and retrieve informations. Now I'm building the application with a doubt. I'm doubtful because I'm open and close Hibernate Session every request. I'm not sure that this ...

4. Cactus, hibernateSession on server don't remove objects    forum.hibernate.org

Hello everybody! I need help. I use cactus test for server-side testing (ejb). I use hibernate and ejb beans, mysql db in my project. When I am testing ejb local interface on server I need to remove objects created during tests from database. Remove method in local interface is deprecated and is absent (for projects requirements). I run Hibernate Session (on ...

5. where to create Hibernatesession object.    forum.hibernate.org

Whatever makes the most sense is the best approach. Usually, creating it in a HibernateService or HibernateUtil class is the most flexible or manageable solution. Here's a sweet little tutorial on how to create a HibernateUtil class in Java. It's pretty helpful: http://jpa.ezhibernate.com/Javacode/learn.jsp?tutorial=05samplehibernateutilclassexample Code: package com.examscam; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.AnnotationConfiguration; import org.hibernate.cfg.Configuration; import org.hibernate.tool.hbm2ddl.SchemaExport; import com.examscam.model.User; public class HibernateUtil ...