Example usage for org.hibernate.engine.spi SessionFactoryImplementor openStatelessSession

List of usage examples for org.hibernate.engine.spi SessionFactoryImplementor openStatelessSession

Introduction

In this page you can find the example usage for org.hibernate.engine.spi SessionFactoryImplementor openStatelessSession.

Prototype

StatelessSession openStatelessSession();

Source Link

Document

Open a new stateless session.

Usage

From source file:org.babyfish.hibernate.dialect.OracleDistinctLimits.java

License:Open Source License

public static void install(SessionFactoryImplementor sfi) {
    if (!SettingsFactory.isDistinctRankCreateable(sfi.getProperties())) {
        return;//from  w ww  .  j a  v  a2s  .  c om
    }
    LOGGER.info(LOGGER_RESOURCE.tryToCreateAnalyticFunction(SettingsFactory.CREATE_ORACLE_DISTINCT_RANK, "true",
            DISTINCT_RANK));
    StatelessSession sls = sfi.openStatelessSession();
    try {
        Connection con = ((SessionImplementor) sls).connection();
        installPLSQLWrapper(con);
    } catch (SQLException ex) {
        throw new QueryException(ex);
    } catch (IOException ex) {
        throw new HibernateException("Can not install the installable dialect", ex);
    } finally {
        sls.close();
    }
}