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

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

Best Java code snippets using org.hibernate.engine.spi.SessionImplementor.connection (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 Connection connection() {
  return delegate.connection();
}
origin: jooby-project/jooby

private void setConnectionReadOnly(final boolean readonly) {
 try {
  Connection connection = ((SessionImplementor) session).connection();
  connection.setReadOnly(readonly);
 } catch (Exception ex) {
  log.trace("session connection.setReadOnly({}) failed: {}", readonly, oid(session), ex);
 }
}
origin: spring-projects/spring-framework

Connection con = ((SessionImplementor) session).connection();
Integer previousHoldability = txObject.getPreviousHoldability();
if (previousHoldability != null) {
origin: spring-projects/spring-framework

    logger.debug("Preparing JDBC Connection of Hibernate Session [" + session + "]");
  Connection con = ((SessionImplementor) session).connection();
  Integer previousIsolationLevel = DataSourceUtils.prepareConnectionForTransaction(con, definition);
  txObject.setPreviousIsolationLevel(previousIsolationLevel);
ConnectionHolder conHolder = new ConnectionHolder(() -> sessionImpl.connection());
if (timeout != TransactionDefinition.TIMEOUT_DEFAULT) {
  conHolder.setTimeoutInSeconds(timeout);
origin: org.springframework/spring-orm

Connection con = ((SessionImplementor) session).connection();
Integer previousHoldability = txObject.getPreviousHoldability();
if (previousHoldability != null) {
origin: org.springframework/spring-orm

    logger.debug("Preparing JDBC Connection of Hibernate Session [" + session + "]");
  Connection con = ((SessionImplementor) session).connection();
  Integer previousIsolationLevel = DataSourceUtils.prepareConnectionForTransaction(con, definition);
  txObject.setPreviousIsolationLevel(previousIsolationLevel);
ConnectionHolder conHolder = new ConnectionHolder(() -> sessionImpl.connection());
if (timeout != TransactionDefinition.TIMEOUT_DEFAULT) {
  conHolder.setTimeoutInSeconds(timeout);
origin: org.jboss.seam/jboss-seam

public Connection connection()
{
 return ((SessionImplementor) delegate).connection();
}
origin: org.hibernate.orm/hibernate-core

@Override
public Connection connection() {
  return delegate.connection();
}
origin: riotfamily/riot

public Connection connection() {
  return session.connection();
}
origin: stackoverflow.com

 public Connection getConnection(final EntityManager em) {
 HibernateEntityManager hem = (HibernateEntityManager) em;
 SessionImplementor sim = (SessionImplementor) hem.getSession();
 return sim.connection();
}
origin: com.atlassian.hibernate/hibernate.adapter

@Override
public Connection connection() throws HibernateException {
  try {
    return sessionImplementor.connection();
  } catch (final PersistenceException ex) {
    throw HibernateExceptionAdapter.adapt(ex);
  }
}
origin: hibernate/hibernate-demos

private Session openSession() throws Exception {
  final Session s = sessionFactory.openSession();
  final SessionImplementor sImpl = (SessionImplementor) s;
  // init GeoDB H2 extension
  GeoDB.InitGeoDB( sImpl.connection() );
  return s;
}
origin: stackoverflow.com

 private Connection getConnection(final EntityManager em) {
   HibernateEntityManager hem = (HibernateEntityManager) em;
   SessionImplementor sim = (SessionImplementor) hem.getSession();
   return sim.connection();
}
origin: org.jooby/jooby-hbm

private void setConnectionReadOnly(final boolean readonly) {
 try {
  Connection connection = ((SessionImplementor) session).connection();
  connection.setReadOnly(readonly);
 } catch (Exception ex) {
  log.trace("session connection.setReadOnly({}) failed: {}", readonly, oid(session), ex);
 }
}
origin: liimaorg/liima

private boolean isH2() {
  org.hibernate.engine.spi.SessionImplementor sessionImp =
      (org.hibernate.engine.spi.SessionImplementor) entityManager.getDelegate();
  String databaseProductName = null;
  try {
    databaseProductName = sessionImp.connection().getMetaData().getDatabaseProductName();
  } catch (SQLException e) {
    e.printStackTrace();
  }
  return databaseProductName.equalsIgnoreCase("H2");
}
origin: com.atlassian.hibernate/hibernate.adapter

@Override
public Connection connection() {
  return getSessionImplementor().connection();
}
origin: Blazebit/blaze-persistence

@Override
protected Connection getConnection(EntityManager em) {
  return em.unwrap(SessionImplementor.class).connection();
}
origin: stackoverflow.com

 @Override
public Serializable generate(SessionImplementor session, Object object) throws HibernateException {
  Connection connection = session.connection();
  CallableStatement callable = null;
  try {
    callable = connection.prepareCall("execute [procedure] ?");
    callable.registerOutParameter(1, Types.INTEGER);
    callable.execute();
    int id = callable.getInt(1);

    return id;
  } catch (SQLException e) {
    (...)
  } finally {
    (...)
  }
}
origin: com.github.albfernandez/jbpm-jpdl

public Connection getConnection() {
 try {
  return ((SessionImplementor) session).connection();
 } catch (Exception e) {
  log.error(e);
  handleException();
  throw new JbpmException( "couldn't get the jdbc connection from hibernate", e );
 }
}
origin: io.shardingsphere/sharding-transaction-spring

@Override
protected Connection getConnectionFromTransactionManager() {
  EntityManager entityManager = createEntityManager();
  Connection result = entityManager.unwrap(SessionImplementor.class).connection();
  TransactionSynchronizationManager.bindResource(transactionManager.getEntityManagerFactory(), new EntityManagerHolder(entityManager));
  return result;
}

org.hibernate.engine.spiSessionImplementorconnection

Popular methods of SessionImplementor

  • getFactory
    Get the creating SessionFactoryImplementor
  • getTransactionCoordinator
  • 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
  • isClosed
    Determine whether the session is closed. Provided separately from #isOpen() as this method does not
  • 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

  • Finding current android device location
  • onCreateOptionsMenu (Activity)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
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