entityManager.getTransaction().begin(); UnitOfWork unitOfWork = (UnitOfWork)((JpaEntityManager)entityManager.getDelegate()).getActiveSession(); unitOfWork.beginEarlyTransaction(); Accessor accessor = unitOfWork.getAccessor(); accessor.incrementCallCount(unitOfWork.getParent()); accessor.decrementCallCount(); java.sql.Connection connection = accessor.getConnection(); ... entityManager.getTransaction().commit();
/** * INTERNAL: * A call to this method will perform a platform based check on the connection and exception * error code to determine if the connection is still valid or if a communication error has occurred. * If a communication error has occurred then the query may be retried. * If this platform is unable to determine if the error was communication based it will return * false forcing the error to be thrown to the user. */ public boolean wasFailureCommunicationBased(SQLException exception, Accessor connection, AbstractSession sessionForProfile){ return getDatabaseSession().getPlatform().wasFailureCommunicationBased(exception, connection.getConnection(), sessionForProfile); }
/** * INTERNAL: * A call to this method will perform a platform based check on the connection and exception * error code to determine if the connection is still valid or if a communication error has occurred. * If a communication error has occurred then the query may be retried. * If this platform is unable to determine if the error was communication based it will return * false forcing the error to be thrown to the user. */ @Override public boolean wasFailureCommunicationBased(SQLException exception, Accessor connection, AbstractSession sessionForProfile){ return getDatabaseSession().getPlatform().wasFailureCommunicationBased(exception, connection.getConnection(), sessionForProfile); }
/** * INTERNAL: * A call to this method will perform a platform based check on the connection and exception * error code to determine if the connection is still valid or if a communication error has occurred. * If a communication error has occurred then the query may be retried. * If this platform is unable to determine if the error was communication based it will return * false forcing the error to be thrown to the user. */ @Override public boolean wasFailureCommunicationBased(SQLException exception, Accessor connection, AbstractSession sessionForProfile){ return getDatabaseSession().getPlatform().wasFailureCommunicationBased(exception, connection.getConnection(), sessionForProfile); }
if (session.isServerSession()) { conn = ((ServerSession)session).getDefaultConnectionPool().acquireConnection().getConnection(); } else if (session.isDatabaseSession()) { conn = ((DatabaseSessionImpl)session).getAccessor().getConnection();
if (session.isServerSession()) { conn = ((ServerSession)session).getDefaultConnectionPool().acquireConnection().getConnection(); } else if (session.isDatabaseSession()) { conn = ((DatabaseSessionImpl)session).getAccessor().getConnection();
if (session.isServerSession()) { conn = ((ServerSession)session).getDefaultConnectionPool().acquireConnection().getConnection(); } else if (session.isDatabaseSession()) { conn = ((DatabaseSessionImpl)session).getAccessor().getConnection();
/** * INTERNAL: * Clears connection's both implicit and explicit caches. */ protected void clearConnectionCache() { this.getSession().getServerPlatform().clearStatementCache(this.getAccessor().getConnection()); ((DatabaseAccessor)this.getAccessor()).clearStatementCache((AbstractSession)this.getSession()); } }
UnitOfWorkImpl unitOfWork = (UnitOfWorkImpl) this.getUnitOfWork(); if(unitOfWork.isInTransaction() || unitOfWork.getParent().isExclusiveIsolatedClientSession()) { return (T) unitOfWork.getAccessor().getConnection(); return (T) accessor.getConnection(); UnitOfWorkImpl unitOfWork = (UnitOfWorkImpl) this.getUnitOfWork(); if(unitOfWork.isInTransaction() || unitOfWork.getParent().isExclusiveIsolatedClientSession()) { return (T) unitOfWork.getAccessor().getConnection();
/** * INTERNAL: * Clears connection's both implicit and explicit caches. */ protected void clearConnectionCache() { this.getSession().getServerPlatform().clearStatementCache(this.getAccessor().getConnection()); ((DatabaseAccessor)this.getAccessor()).clearStatementCache((AbstractSession)this.getSession()); } }
accessor.incrementCallCount(databaseSession); try { OracleConnection connection = (OracleConnection)databaseSession.getServerPlatform().unwrapConnection(accessor.getConnection()); databaseSession.log(SessionLog.FINEST, SessionLog.CONNECTION, "dcn_registering"); Properties properties = new Properties();
accessor.incrementCallCount(databaseSession); try { OracleConnection connection = (OracleConnection)databaseSession.getServerPlatform().unwrapConnection(accessor.getConnection()); databaseSession.log(SessionLog.FINEST, SessionLog.CONNECTION, "dcn_registering"); Properties properties = new Properties();
/** * INTERNAL: * Remove the event listener from the database. */ public void remove(Session session) { if (this.register == null) { return; } AbstractSession databaseSession = (AbstractSession)session; Accessor accessor = databaseSession.getAccessor(); accessor.incrementCallCount(databaseSession); try { OracleConnection connection = (OracleConnection)databaseSession.getServerPlatform().unwrapConnection(accessor.getConnection()); databaseSession.log(SessionLog.FINEST, SessionLog.CONNECTION, "dcn_unregister"); try { connection.unregisterDatabaseChangeNotification(this.register); } catch (SQLException exception) { throw DatabaseException.sqlException(exception, databaseSession.getAccessor(), databaseSession, false); } } finally { accessor.decrementCallCount(); } }
/** * INTERNAL: * Remove the event listener from the database. */ @Override public void remove(Session session) { if (this.register == null) { return; } AbstractSession databaseSession = (AbstractSession)session; Accessor accessor = databaseSession.getAccessor(); accessor.incrementCallCount(databaseSession); try { OracleConnection connection = (OracleConnection)databaseSession.getServerPlatform().unwrapConnection(accessor.getConnection()); databaseSession.log(SessionLog.FINEST, SessionLog.CONNECTION, "dcn_unregister"); try { connection.unregisterDatabaseChangeNotification(this.register); } catch (SQLException exception) { throw DatabaseException.sqlException(exception, databaseSession.getAccessor(), databaseSession, false); } } finally { accessor.decrementCallCount(); } }
Connection connection = accessor.getConnection(); if(connection instanceof OracleConnection) { oracleConnection = (OracleConnection)connection;
Connection connection = accessor.getConnection(); if(connection instanceof OracleConnection) { oracleConnection = (OracleConnection)connection;