Example usage for org.hibernate FlushMode AUTO

List of usage examples for org.hibernate FlushMode AUTO

Introduction

In this page you can find the example usage for org.hibernate FlushMode AUTO.

Prototype

FlushMode AUTO

To view the source code for org.hibernate FlushMode AUTO.

Click Source Link

Document

The Session is sometimes flushed before query execution in order to ensure that queries never return stale state.

Usage

From source file:entityclasses.UTSPersistentManager.java

private UTSPersistentManager() throws PersistentException {
    super(_connectionSetting, _sessionType, _timeToAlive, new String[] {}, _extraProperties,
            _configurationFile);/*from   ww  w  .j a  v a2s  .c  om*/
    setFlushMode(FlushMode.AUTO);
}

From source file:entitymodelling.ormweek11.Week11PersistentManager.java

private Week11PersistentManager() throws PersistentException {
    super(_connectionSetting, _sessionType, _timeToAlive, new String[] {}, _extraProperties,
            _configurationFile);/*from  www  .  j a v  a2 s.co m*/
    setFlushMode(FlushMode.AUTO);
}

From source file:es.tekniker.eefrmwrk.gcm.mng.dao.domain.GCMPersistentManager.java

private GCMPersistentManager() throws PersistentException {
    super(_connectionSetting, _sessionType, _timeToAlive, new String[] {}, _extraProperties,
            _configurationFile);// w w w . j a  v  a 2 s .co m
    setFlushMode(FlushMode.AUTO);
}

From source file:es.tekniker.eefrmwrk.monitoring.tac.dao.domain.TACPersistentManager.java

private TACPersistentManager() throws PersistentException {
    super(_connectionSetting, _sessionType, _timeToAlive, new String[] {}, _extraProperties,
            _configurationFile);//from  w  w  w  . j  a  v a  2 s.c o m
    setFlushMode(FlushMode.AUTO);
}

From source file:eu.epichub.gateway.eg.manager.EHReqPersistentManager.java

private EHReqPersistentManager() throws PersistentException {
    super(_connectionSetting, _sessionType, _timeToAlive, new String[] {}, _extraProperties,
            _configurationFile);/*from   w  w w. j  av a2s  .  com*/
    setFlushMode(FlushMode.AUTO);
}

From source file:eventapp.ArchitecturePersistentManager.java

private ArchitecturePersistentManager() throws PersistentException {
    super(_connectionSetting, _sessionType, _timeToAlive, new String[] {}, _extraProperties,
            _configurationFile);/* w  w w  .j  a v  a2s  . c om*/
    setFlushMode(FlushMode.AUTO);
}

From source file:foundation.TimeLoggingPersistentManager.java

private TimeLoggingPersistentManager() throws PersistentException {
    super(_connectionSetting, _sessionType, _timeToAlive, new String[] {}, _extraProperties);
    setFlushMode(FlushMode.AUTO);
}

From source file:grails.plugins.quartz.listeners.SessionBinderJobListener.java

License:Apache License

public void jobToBeExecuted(JobExecutionContext context) {
    Session session = SessionFactoryUtils.getSession(sessionFactory, true);
    session.setFlushMode(FlushMode.AUTO);
    TransactionSynchronizationManager.bindResource(sessionFactory, new SessionHolder(session));
    if (LOG.isDebugEnabled())
        LOG.debug("Hibernate Session is bounded to Job thread");
}

From source file:griffon.plugins.hibernate3.internal.HibernateSchemaHelper.java

License:Apache License

public void updateDatabaseSchema() {
    if (LOG.isDebugEnabled()) {
        LOG.info("Updating database schema for Hibernate SessionFactory");
    }//  w ww  .  j a  v  a 2s. com
    execute(new HibernateCallback() {
        public void doInSession(Session session) throws SQLException {
            session.setFlushMode(FlushMode.AUTO);
            Connection con = session.connection();
            Dialect dialect = Dialect.getDialect(getConfiguration().getProperties());
            DatabaseMetadata metadata = new DatabaseMetadata(con, dialect);
            String[] sql = getConfiguration().generateSchemaUpdateScript(dialect, metadata);
            executeSchemaScript(con, sql);
        }
    });
}

From source file:hibernate.ProtoPersistentManager.java

private ProtoPersistentManager() throws PersistentException {
    super(_connectionSetting, _sessionType, _timeToAlive, new String[] {}, _extraProperties,
            _configurationFile);//from  w  ww.  ja v a2 s  .  c o m
    setFlushMode(FlushMode.AUTO);
}