Codota Logo
SessionImplementor.isClosed
Code IndexAdd Codota to your IDE (free)

How to use
isClosed
method
in
org.hibernate.engine.spi.SessionImplementor

Best Java code snippets using org.hibernate.engine.spi.SessionImplementor.isClosed (Showing top 20 results out of 315)

  • Common ways to obtain SessionImplementor
private void myMethod () {
SessionImplementor s =
  • Codota IconEntityManager entityManager;entityManager.unwrap(SessionImplementor.class)
  • Codota IconFlushEntityEvent flushEntityEvent;flushEntityEvent.getSession()
  • Codota IconLazyInitializer lazyInitializer;lazyInitializer.getSession()
  • Smart code suggestions by Codota
}
origin: hibernate/hibernate-orm

@Override
public boolean isClosed() {
  return delegate.isClosed();
}
origin: hibernate/hibernate-orm

private void cleanupSession() {
  if ( session != null && ! ( (SessionImplementor) session ).isClosed() ) {
    session.close();
  }
  session = null;
}
origin: hibernate/hibernate-orm

private void cleanupSession() {
  if ( session != null && ! ( (SessionImplementor) session ).isClosed() ) {
    session.close();
  }
  session = null;
}
origin: hibernate/hibernate-orm

  @Override
  public boolean shouldDoManagedFlush(SessionImplementor session) {
    return !session.isClosed()
        && session.getHibernateFlushMode() == FlushMode.MANUAL;
  }
}
origin: hibernate/hibernate-orm

  @Override
  public boolean shouldDoManagedFlush(SessionImplementor session) {
    if ( session.isClosed() ) {
      return false;
    }
    return session.getHibernateFlushMode() != FlushMode.MANUAL;
  }
}
origin: hibernate/hibernate-orm

  @Override
  public void doAction(boolean successful, SessionImplementor session) {
    if ( session.isClosed() ) {
      log.trace( "Session was closed; nothing to do" );
      return;
    }

    if ( !successful && session.getTransactionCoordinator().getTransactionCoordinatorBuilder().isJta() ) {
      session.clear();
    }
  }
}
origin: hibernate/hibernate-orm

@After
public void tearDown() throws Exception {
  if ( sessionImpl != null && !sessionImpl.isClosed() ) {
    ((Session) sessionImpl).close();
  }
  if ( sessionFactory != null ) {
    sessionFactory.close();
  }
  if ( serviceRegistry != null ) {
    StandardServiceRegistryBuilder.destroy( serviceRegistry );
  }
}
origin: hibernate/hibernate-orm

private void completeStrayTransaction() {
  if ( session == null ) {
    // nothing to do
    return;
  }
  if ( ( (SessionImplementor) session ).isClosed() ) {
    // nothing to do
    return;
  }
  if ( !session.isConnected() ) {
    // nothing to do
    return;
  }
  final TransactionCoordinator.TransactionDriver tdc =
      ( (SessionImplementor) session ).getTransactionCoordinator().getTransactionDriverControl();
  if ( tdc.getStatus().canRollback() ) {
    session.getTransaction().rollback();
  }
  session.close();
}
origin: hibernate/hibernate-orm

if ( FlushMode.MANUAL.equals( session.getHibernateFlushMode() ) || session.isClosed() ) {
  Session temporarySession = null;
  try {
origin: hibernate/hibernate-orm

private void completeStrayTransaction() {
  if ( session == null ) {
    // nothing to do
    return;
  }
  if ( ( (SessionImplementor) session ).isClosed() ) {
    // nothing to do
    return;
  }
  if ( !session.isConnected() ) {
    // nothing to do
    return;
  }
  final TransactionCoordinator.TransactionDriver tdc =
      ( (SessionImplementor) session ).getTransactionCoordinator().getTransactionDriverControl();
  if ( tdc.getStatus().canRollback() ) {
    session.getTransaction().rollback();
  }
}
origin: hibernate/hibernate-orm

if ( !( (SessionImplementor) session ).isClosed() ) {
  session.close();
origin: hibernate/hibernate-orm

assertTrue( ( (SessionImplementor) s ).isClosed() );
try {
  ( ( HibernateProxy ) dp ).getHibernateLazyInitializer().setSession( ( SessionImplementor ) s );            
origin: org.hibernate/com.springsource.org.hibernate

@Override
public final boolean isReadOnlySettingAvailable() {
  return ( session != null && ! session.isClosed() );
}
origin: org.jboss.seam/jboss-seam

public boolean isClosed()
{
 return ((SessionImplementor) delegate).isClosed();
}
origin: org.hibernate/com.springsource.org.hibernate.core

@Override
public final boolean isReadOnlySettingAvailable() {
  return ( session != null && ! session.isClosed() );
}
origin: org.hibernate.orm/hibernate-core

  @Override
  public boolean shouldDoManagedFlush(SessionImplementor session) {
    if ( session.isClosed() ) {
      return false;
    }
    return session.getHibernateFlushMode() != FlushMode.MANUAL;
  }
}
origin: com.atlassian.hibernate/hibernate.adapter

private static void errorIfClosed(final SessionImplementor sessionImplementor) {
  if (sessionImplementor.isClosed()) {
    throw new org.hibernate.SessionException("Session is closed!");
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

private void errorIfReadOnlySettingNotAvailable() {
  if ( session == null ) {
    throw new TransientObjectException(
        "Proxy is detached (i.e, session is null). The read-only/modifiable setting is only accessible when the proxy is associated with an open session." );
  }
  if ( session.isClosed() ) {
    throw new SessionException(
        "Session is closed. The read-only/modifiable setting is only accessible when the proxy is associated with an open session." );
  }
}
origin: org.hibernate/com.springsource.org.hibernate

private void errorIfReadOnlySettingNotAvailable() {
  if ( session == null ) {
    throw new TransientObjectException(
        "Proxy is detached (i.e, session is null). The read-only/modifiable setting is only accessible when the proxy is associated with an open session." );
  }
  if ( session.isClosed() ) {
    throw new SessionException(
        "Session is closed. The read-only/modifiable setting is only accessible when the proxy is associated with an open session." );
  }
}
origin: org.hibernate.orm/hibernate-core

  @Override
  public void doAction(boolean successful, SessionImplementor session) {
    if ( session.isClosed() ) {
      log.trace( "Session was closed; nothing to do" );
      return;
    }

    if ( !successful && session.getTransactionCoordinator().getTransactionCoordinatorBuilder().isJta() ) {
      session.clear();
    }
  }
}
org.hibernate.engine.spiSessionImplementorisClosed

Javadoc

Determine whether the session is closed. Provided separately from #isOpen() as this method does not attempt any JTA synchronization registration, where as #isOpen() does; which makes this one nicer to use for most internal purposes.

Popular methods of SessionImplementor

  • getFactory
    Get the creating SessionFactoryImplementor
  • getTransactionCoordinator
  • connection
  • getPersistenceContext
    Get the persistence context for this session
  • getLoadQueryInfluencers
    Get the load query influencers associated with this session.
  • isTransactionInProgress
    Does this Session have an active Hibernate transaction or is there a JTA transaction in progress?
  • getEntityPersister
    Get the EntityPersister for any instance
  • getJdbcCoordinator
  • flush
  • getTenantIdentifier
    Match te method on org.hibernate.Session and org.hibernate.StatelessSession
  • generateEntityKey
  • getContextEntityIdentifier
  • generateEntityKey,
  • getContextEntityIdentifier,
  • isOpen,
  • bestGuessEntityName,
  • getFlushMode,
  • getSessionFactory,
  • guessEntityName,
  • immediateLoad,
  • initializeCollection

Popular in Java

  • Running tasks concurrently on multiple threads
  • setScale (BigDecimal)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • notifyDataSetChanged (ArrayAdapter)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • JFileChooser (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
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