Tabnine Logo
org.eclipse.persistence.internal.databaseaccess
Code IndexAdd Tabnine to your IDE (free)

How to use org.eclipse.persistence.internal.databaseaccess

Best Java code snippets using org.eclipse.persistence.internal.databaseaccess (Showing top 20 results out of 315)

origin: stackoverflow.com

 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();
origin: com.haulmont.thirdparty/eclipselink

/**
 * Rollback a transaction on the database. This means toggling the auto-commit option.
 */
public void rollbackTransaction(AbstractSession session) throws DatabaseException {
  getActiveBatchWritingMechanism(session).clear();
  super.rollbackTransaction(session);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Allow for the field order to be matched if required.
 * This is required for custom SQL.
 */
public void matchFieldOrder(ResultSet resultSet, DatabaseAccessor accessor, AbstractSession session) {
  if ((getFields() != null) && (!isFieldMatchingRequired())) {
    return;
  }
  setFields(accessor.buildSortedFields(getFields(), resultSet, session));
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

public void populateRow(DatabaseField[] fieldsArray, Object[] values, ResultSet resultSet, ResultSetMetaData metaData, AbstractSession session, int startIndex, int endIndex) throws DatabaseException {
  // PERF: Pass platform and optimize data flag.
  DatabasePlatform platform = getPlatform();
  boolean optimizeData = platform.shouldOptimizeDataConversion();
  for (int index = startIndex; index < endIndex; index++) {
    DatabaseField field = fieldsArray[index];
    // Field can be null for fetch groups.
    if (field != null) {
      values[index] = getObject(resultSet, field, metaData, index + 1, platform, optimizeData, session);
    }
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Swaps out the Mechanism for the other Mechanism
 */
protected void switchMechanisms(AbstractSession session, DatabaseCall dbCall) {
  this.databaseAccessor.setActiveBatchWritingMechanismToDynamicSQL();
  this.databaseAccessor.getActiveBatchWritingMechanism(session).appendCall(session, dbCall);
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * This method is used to switch from this mechanism to the alternate automatically
 */
protected void switchMechanisms(AbstractSession session, DatabaseCall dbCall) {
  this.databaseAccessor.setActiveBatchWritingMechanismToParameterizedSQL();
  this.databaseAccessor.getActiveBatchWritingMechanism(session).appendCall(session, dbCall);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  /**
   * This method will be called after a series of writes have been issued to
   * mark where a particular set of writes has completed.  It will be called
   * from commitTransaction and may be called from writeChanges.   Its main
   * purpose is to ensure that the batched statements have been executed
   */
  public void writesCompleted(AbstractSession session) {
    if (isInBatchWritingMode(session)) {
      getActiveBatchWritingMechanism().executeBatchedStatements(session);
    }
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Disconnect from the datasource.
 * Added for bug 3046465 to ensure the statement cache is cleared.
 */
@Override
public void disconnect(AbstractSession session) throws DatabaseException {
  clearStatementCache(session);
  super.disconnect(session);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Close the accessor's connection.
 * This is used only for external connection pooling
 * when it is intended for the connection to be reconnected in the future.
 */
@Override
public void closeConnection() {
  // Unfortunately do not have the session to pass, fortunately it is not used.
  clearStatementCache(null);
  super.closeConnection();
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 *    Commit a transaction on the database. First flush any batched statements.
 */
@Override
public void commitTransaction(AbstractSession session) throws DatabaseException {
  this.writesCompleted(session);
  super.commitTransaction(session);
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * Attempt to save some of the cost associated with getting a fresh connection.
 * Assume the DatabaseDriver has been cached, if appropriate.
 * Note: Connections that are participating in transactions will not be refreshed.^M
 * Added for bug 3046465 to ensure the statement cache is cleared
 */
protected void reconnect(AbstractSession session) {
  clearStatementCache(session);
  super.reconnect(session);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Set customizer, customize the connection if it's available.
 */
protected void setCustomizer(ConnectionCustomizer newCustomizer) {
  this.customizer = newCustomizer;
  if(getDatasourceConnection() != null) {
    customizer.customize();
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * Return the batch writing mode.
 */
protected boolean isInBatchWritingMode(AbstractSession session) {
  return getPlatform().usesBatchWriting() && this.isInTransaction;
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * Connect to the database.
 * Exceptions are caught and re-thrown as EclipseLink exceptions.
 * Must set the transaction isolation.
 */
protected void connectInternal(Login login, AbstractSession session) throws DatabaseException {
  super.connectInternal(login, session);
  checkTransactionIsolation(session);
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * Allow for the field order to be matched if required.
 * This is required for custom SQL.
 */
public void matchFieldOrder(ResultSet resultSet, DatabaseAccessor accessor, AbstractSession session) {
  if ((getFields() != null) && (!isFieldMatchingRequired())) {
    return;
  }
  setFields(accessor.buildSortedFields(getFields(), resultSet, session));
}
origin: com.haulmont.thirdparty/eclipselink

public void populateRow(DatabaseField[] fieldsArray, Object[] values, ResultSet resultSet, ResultSetMetaData metaData, AbstractSession session, int startIndex, int endIndex) throws DatabaseException {
  // PERF: Pass platform and optimize data flag.
  DatabasePlatform platform = getPlatform();
  boolean optimizeData = platform.shouldOptimizeDataConversion();
  for (int index = startIndex; index < endIndex; index++) {
    DatabaseField field = fieldsArray[index];
    // Field can be null for fetch groups.
    if (field != null) {
      values[index] = getObject(resultSet, field, metaData, index + 1, platform, optimizeData, session);
    }
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Swaps out the Mechanism for the other Mechanism
 */
protected void switchMechanisms(AbstractSession session, DatabaseCall dbCall) {
  this.databaseAccessor.setActiveBatchWritingMechanismToDynamicSQL();
  this.databaseAccessor.getActiveBatchWritingMechanism(session).appendCall(session, dbCall);
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * Disconnect from the datasource.
 * Added for bug 3046465 to ensure the statement cache is cleared.
 */
@Override
public void disconnect(AbstractSession session) throws DatabaseException {
  clearStatementCache(session);
  super.disconnect(session);
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * Close the accessor's connection.
 * This is used only for external connection pooling
 * when it is intended for the connection to be reconnected in the future.
 */
@Override
public void closeConnection() {
  // Unfortunately do not have the session to pass, fortunately it is not used.
  clearStatementCache(null);
  super.closeConnection();
}
origin: com.haulmont.thirdparty/eclipselink

/**
 *    Commit a transaction on the database. First flush any batched statements.
 */
@Override
public void commitTransaction(AbstractSession session) throws DatabaseException {
  this.writesCompleted(session);
  super.commitTransaction(session);
}
org.eclipse.persistence.internal.databaseaccess

Most used classes

  • Platform
    Platform is private to TopLink. It encapsulates behavior specific to a datasource platform (eg. Orac
  • FieldTypeDefinition
    INTERNAL:Purpose: Define a database platform specific definition for a platform independant Java cla
  • Accessor
    INTERNAL: Accessor defines the interface used primarily by the assorted TopLink Sessions to interact
  • BindCallCustomParameter
    INTERNAL:Purpose: To provide a base type for customary parameters' types used for binding by Databas
  • DatabaseAccessor
    INTERNAL: DatabaseAccessor is private to EclipseLink. It encapsulates low level database operations
  • DatabaseCall,
  • DatasourceCall,
  • OutputParameterForCallableStatement,
  • AppendCallCustomParameter,
  • BatchWritingMechanism,
  • ConnectionCustomizer$Empty,
  • ConnectionCustomizer,
  • DatasourceAccessor,
  • DatasourcePlatform,
  • DynamicSQLBatchWritingMechanism,
  • InOutputParameterForCallableStatement,
  • InParameterForCallableStatement,
  • ParameterizedSQLBatchWritingMechanism,
  • SimpleAppendCallCustomParameter
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now