Example usage for org.hibernate SessionFactory openStatelessSession

List of usage examples for org.hibernate SessionFactory openStatelessSession

Introduction

In this page you can find the example usage for org.hibernate SessionFactory openStatelessSession.

Prototype

StatelessSession openStatelessSession(Connection connection);

Source Link

Document

Open a new stateless session, utilizing the specified JDBC Connection .

Usage

From source file:org.dcm4chee.archive.ejb.query.CompositeQueryBean.java

License:LGPL

@PostConstruct
protected void init() {
    SessionFactory sessionFactory = ((HibernateEntityManagerFactory) emf).getSessionFactory();
    try {//w  ww .  j a  v  a 2 s.  c om
        connection = dataSource.getConnection();
    } catch (SQLException e) {
        throw new EJBException(e);
    }
    session = sessionFactory.openStatelessSession(connection);
}