Codota Logo
SessionImpl.getConnectionReleaseMode
Code IndexAdd Codota to your IDE (free)

How to use
getConnectionReleaseMode
method
in
org.hibernate.impl.SessionImpl

Best Java code snippets using org.hibernate.impl.SessionImpl.getConnectionReleaseMode (Showing top 2 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: apache/servicemix-bundles

/**
 * Return whether the given Hibernate Session will always hold the same
 * JDBC Connection. This is used to check whether the transaction manager
 * can safely prepare and clean up the JDBC Connection used for a transaction.
 * <p>Default implementation checks the Session's connection release mode
 * to be "on_close". Unfortunately, this requires casting to SessionImpl,
 * as of Hibernate 3.1. If that cast doesn't work, we'll simply assume
 * we're safe and return {@code true}.
 * @param session the Hibernate Session to check
 * @see org.hibernate.impl.SessionImpl#getConnectionReleaseMode()
 * @see org.hibernate.ConnectionReleaseMode#ON_CLOSE
 */
protected boolean isSameConnectionForEntireSession(Session session) {
  if (!(session instanceof SessionImpl)) {
    // The best we can do is to assume we're safe.
    return true;
  }
  ConnectionReleaseMode releaseMode = ((SessionImpl) session).getConnectionReleaseMode();
  return ConnectionReleaseMode.ON_CLOSE.equals(releaseMode);
}
origin: org.beangle.commons/beangle-commons-orm

/**
 * Return whether the given Hibernate Session will always hold the same
 * JDBC Connection. This is used to check whether the transaction manager
 * can safely prepare and clean up the JDBC Connection used for a transaction.
 * <p>
 * Default implementation checks the Session's connection release mode to be "on_close".
 * Unfortunately, this requires casting to SessionImpl, as of Hibernate 3.1. If that cast doesn't
 * work, we'll simply assume we're safe and return <code>true</code>.
 * 
 * @param session the Hibernate Session to check
 * @see org.hibernate.impl.SessionImpl#getConnectionReleaseMode()
 * @see org.hibernate.ConnectionReleaseMode#ON_CLOSE
 */
protected boolean isSameConnectionForEntireSession(Session session) {
 if (!(session instanceof SessionImpl)) {
  // The best we can do is to assume we're safe.
  return true;
 }
 ConnectionReleaseMode releaseMode = ((SessionImpl) session).getConnectionReleaseMode();
 return ConnectionReleaseMode.ON_CLOSE.equals(releaseMode);
}
org.hibernate.implSessionImplgetConnectionReleaseMode

Popular methods of SessionImpl

  • getFactory
  • <init>
    Constructor used in building "child sessions".
  • afterOperation
    Check if there is a Hibernate or JTA transaction in progress and, if there is not, flush if necessar
  • autoFlushIfRequired
    detect in-memory changes, determine if the changes are to tables named in the query and, if so, comp
  • cleanup
    clear all the internal collections, just to help the garbage collector, does not clear anything that
  • clear
  • close
  • delete
  • find
    Retrieve a list of persistent objects using a hibernate query
  • flush
  • get
  • getEnabledFilters
  • get,
  • getEnabledFilters,
  • getFlushMode,
  • getOuterJoinLoadable,
  • getProxyIdentifier,
  • guessEntityName,
  • isAutoCloseSessionEnabled,
  • iterate,
  • list

Popular in Java

  • Making http post requests using okhttp
  • onCreateOptionsMenu (Activity)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • getExternalFilesDir (Context)
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now