org.hibernate.classic.Session.flush()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(263)

本文整理了Java中org.hibernate.classic.Session.flush()方法的一些代码示例,展示了Session.flush()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Session.flush()方法的具体详情如下:
包路径:org.hibernate.classic.Session
类名称:Session
方法名:flush

Session.flush介绍

暂无

代码示例

代码示例来源:origin: org.jboss.identity.idm/idm-hibernate

public void save() throws IdentityException
{
 sessionFactory.getCurrentSession().flush();
}

代码示例来源:origin: uk.ac.ebi.intact/intact-core

public void flushSession() {
  sessionFactory.getCurrentSession().flush();
}

代码示例来源:origin: com.atlassian.osuser/osuser-provider-hibernate3

public void closeSession(Session session) {
  try {
    session.flush();
    session.close();
  } catch (HibernateException he) {
    if (log.isDebugEnabled()) {
      log.debug("HibernateException caught closing connection.");
    }
  }
}

代码示例来源:origin: com.atlassian.osuser/osuser-provider-hibernate3

public void flushCloseSession(Session session) {
    try {
      session.flush();

      if (!session.connection().getAutoCommit()) {
        session.connection().commit();
      }

      this.closeSession(session);
    } catch (HibernateException he) {
      if (log.isDebugEnabled()) {
        log.debug("HibernateException caught during flush/commit.", he);
      }
    } catch (SQLException sqle) {
      if (log.isDebugEnabled()) {
        log.debug("SQLException caught during commit.", sqle);
      }
    }
  }
}

代码示例来源:origin: denimgroup/threadfix

@Override
public void saveOrUpdate(ChannelSeverity channelSeverity) {
  if (channelSeverity.getSeverityMap() != null) {
    sessionFactory.getCurrentSession().saveOrUpdate(channelSeverity.getSeverityMap());
  }
  sessionFactory.getCurrentSession().saveOrUpdate(channelSeverity);
  sessionFactory.getCurrentSession().flush();
  sessionFactory.getCurrentSession().refresh(channelSeverity);
}

代码示例来源:origin: com.atlassian.osuser/osuser-provider-hibernate3

public boolean saveGroup(HibernateGroup group) {
    boolean result = false;
    Serializable id = null;
    Session session = null;

    try {
      session = this.sessionManager.getSession();
      id = session.save(group);
      result = (id != null);
    } catch (HibernateException he) {
      if (log.isDebugEnabled()) {
        log.debug("HibernateException caught saving");
      }

      return false;
    } finally {
      try {
        session.flush();
      } catch (HibernateException e) {
        log.error("did not flush group", e);
      }

      this.sessionManager.flushCloseSession(session);
    }

    return result;
  }
}

代码示例来源:origin: david-schuler/javalanche

stp.start();
flushs++;
session.flush();

代码示例来源:origin: jtalks-org/jcommune

/**
   * {@inheritDoc}
   */
  @Override
  public void updateProperties(List<PluginProperty> properties) {

    for (PluginProperty property: properties) {
      PluginProperty persistedProperty = (PluginProperty) session().load(property.getClass(), property.getId());
      persistedProperty.setValue(property.getValue());
      session().saveOrUpdate(persistedProperty);
    }

    session().flush();
  }
}

相关文章