Examples of TransactionIsolation


Examples of org.apache.flume.channel.jdbc.TransactionIsolation

    // Transaction Isolation
    String txIsolation = context.getString(
        ConfigurationConstants.CONFIG_TX_ISOLATION_LEVEL,
        TransactionIsolation.READ_COMMITTED.getName());

    TransactionIsolation txIsolationLevel =
        TransactionIsolation.getByName(txIsolation);

    LOGGER.debug("Transaction isolation will be set to: " + txIsolationLevel);

    // Setup Datasource
    ConnectionFactory connFactory =
        new DriverManagerConnectionFactory(connectUrl, jdbcProps);

    connectionPool = new GenericObjectPool();

    String maxActiveConnections = context.getString(
        ConfigurationConstants.CONFIG_MAX_CONNECTION, "10");

    int maxActive = 10;
    if (maxActiveConnections != null && maxActiveConnections.length() > 0) {
      try {
        maxActive = Integer.parseInt(maxActiveConnections);
      } catch (NumberFormatException nfe) {
        LOGGER.warn("Max active connections has invalid value: "
                + maxActiveConnections + ", Using default: " + maxActive);
      }
    }

    LOGGER.debug("Max active connections for the pool: " + maxActive);
    connectionPool.setMaxActive(maxActive);

    statementPool = new GenericKeyedObjectPoolFactory(null);

    // Creating the factory instance automatically wires the connection pool
    new PoolableConnectionFactory(connFactory, connectionPool, statementPool,
        databaseType.getValidationQuery(), false, false,
        txIsolationLevel.getCode());

    dataSource = new PoolingDataSource(connectionPool);

    txFactory = new JdbcTransactionFactory(dataSource);
  }
View Full Code Here

Examples of org.apache.flume.channel.jdbc.TransactionIsolation

    String txIsolation = getConfigurationString(context,
        ConfigurationConstants.CONFIG_TX_ISOLATION_LEVEL,
        ConfigurationConstants.OLD_CONFIG_TX_ISOLATION_LEVEL,
        TransactionIsolation.READ_COMMITTED.getName());

    TransactionIsolation txIsolationLevel =
        TransactionIsolation.getByName(txIsolation);

    LOGGER.debug("Transaction isolation will be set to: " + txIsolationLevel);

    // Setup Datasource
    ConnectionFactory connFactory =
        new DriverManagerConnectionFactory(connectUrl, jdbcProps);

    connectionPool = new GenericObjectPool();

    String maxActiveConnections = getConfigurationString(context,
        ConfigurationConstants.CONFIG_MAX_CONNECTIONS,
        ConfigurationConstants.OLD_CONFIG_MAX_CONNECTIONS, "10");

    int maxActive = 10;
    if (maxActiveConnections != null && maxActiveConnections.length() > 0) {
      try {
        maxActive = Integer.parseInt(maxActiveConnections);
      } catch (NumberFormatException nfe) {
        LOGGER.warn("Max active connections has invalid value: "
                + maxActiveConnections + ", Using default: " + maxActive);
      }
    }

    LOGGER.debug("Max active connections for the pool: " + maxActive);
    connectionPool.setMaxActive(maxActive);

    statementPool = new GenericKeyedObjectPoolFactory(null);

    // Creating the factory instance automatically wires the connection pool
    new PoolableConnectionFactory(connFactory, connectionPool, statementPool,
        databaseType.getValidationQuery(), false, false,
        txIsolationLevel.getCode());

    dataSource = new PoolingDataSource(connectionPool);

    txFactory = new JdbcTransactionFactory(dataSource, this);
  }
View Full Code Here

Examples of org.apache.flume.channel.jdbc.TransactionIsolation

    // Transaction Isolation
    String txIsolation = context.getString(
        ConfigurationConstants.CONFIG_TX_ISOLATION_LEVEL,
        TransactionIsolation.READ_COMMITTED.getName());

    TransactionIsolation txIsolationLevel =
        TransactionIsolation.getByName(txIsolation);

    LOGGER.debug("Transaction isolation will be set to: " + txIsolationLevel);

    // Setup Datasource
    ConnectionFactory connFactory =
        new DriverManagerConnectionFactory(connectUrl, jdbcProps);

    connectionPool = new GenericObjectPool();

    String maxActiveConnections = context.getString(
        ConfigurationConstants.CONFIG_MAX_CONNECTION, "10");

    int maxActive = 10;
    if (maxActiveConnections != null && maxActiveConnections.length() > 0) {
      try {
        maxActive = Integer.parseInt(maxActiveConnections);
      } catch (NumberFormatException nfe) {
        LOGGER.warn("Max active connections has invalid value: "
                + maxActiveConnections + ", Using default: " + maxActive);
      }
    }

    LOGGER.debug("Max active connections for the pool: " + maxActive);
    connectionPool.setMaxActive(maxActive);

    statementPool = new GenericKeyedObjectPoolFactory(null);

    // Creating the factory instance automatically wires the connection pool
    new PoolableConnectionFactory(connFactory, connectionPool, statementPool,
        databaseType.getValidationQuery(), false, false,
        txIsolationLevel.getCode());

    dataSource = new PoolingDataSource(connectionPool);

    txFactory = new JdbcTransactionFactory(dataSource);
  }
View Full Code Here

Examples of org.apache.ojb.otm.lock.isolation.TransactionIsolation

                           PersistenceBroker pb)
        throws LockingException
    {
        LockMap lockMap = tx.getKit().getLockMap();
        ObjectLock objectLock = lockMap.getLock(oid);
        TransactionIsolation isolation;

        isolation = IsolationFactory.getIsolationLevel(pb, objectLock);

        if (lock == LockType.READ_LOCK)
        {
            isolation.readLock(tx, objectLock);
        }
        else if (lock == LockType.WRITE_LOCK)
        {
            isolation.writeLock(tx, objectLock);
        }
    }
View Full Code Here

Examples of org.apache.ojb.otm.lock.isolation.TransactionIsolation

        // Class clazz = lock.getTargetIdentity().getObjectsTopLevelClass();
        Class clazz = lock.getTargetIdentity().getObjectsRealClass();
        ClassDescriptor classDescriptor = pb.getClassDescriptor(clazz);
        int isolationLevel = classDescriptor.getIsolationLevel();

        TransactionIsolation isolation = null;
        switch (isolationLevel) {

            case IsolationLevels.IL_READ_UNCOMMITTED:
                isolation = READ_UNCOMMITTED_ISOLATION;
                break;
View Full Code Here

Examples of org.apache.ojb.otm.lock.isolation.TransactionIsolation

                           PersistenceBroker pb)
        throws LockingException
    {
        LockMap lockMap = tx.getKit().getLockMap();
        ObjectLock objectLock = lockMap.getLock(oid);
        TransactionIsolation isolation;

        isolation = IsolationFactory.getIsolationLevel(pb, objectLock);

        if (lock == LockType.READ_LOCK)
        {
            isolation.readLock(tx, objectLock);
        }
        else if (lock == LockType.WRITE_LOCK)
        {
            isolation.writeLock(tx, objectLock);
        }
    }
View Full Code Here

Examples of org.jboss.jca.common.api.metadata.ds.TransactionIsolation

     
      Long preparedStatementsCacheSize = null;
      Boolean sharePreparedStatements = Defaults.SHARE_PREPARED_STATEMENTS;
      TrackStatementsEnum trackStatements = TrackStatementsEnum.FALSE;
     
      TransactionIsolation transactionIsolation = TransactionIsolation.TRANSACTION_NONE;
      String securityDomain = null;
      //Extension reauthPlugin = null;
     
      Boolean backgroundValidation = Defaults.BACKGROUND_VALIDATION;
      Long backgroundValidationMillis = null;
View Full Code Here

Examples of org.jboss.jca.common.api.metadata.ds.TransactionIsolation

      Long preparedStatementsCacheSize = null;
      Boolean sharePreparedStatements = Defaults.SHARE_PREPARED_STATEMENTS;
      TrackStatementsEnum trackStatements = TrackStatementsEnum.FALSE;
      Boolean setTxQueryTimeout = Defaults.SET_TX_QUERY_TIMEOUT;
     
      TransactionIsolation transactionIsolation = TransactionIsolation.TRANSACTION_NONE;
      String securityDomain = null;
      //Extension reauthPlugin = null;
     
      Boolean backgroundValidation = Defaults.BACKGROUND_VALIDATION;
      Long backgroundValidationMillis = null;
View Full Code Here

Examples of org.jboss.jca.common.api.metadata.ds.TransactionIsolation

    */
   protected org.jboss.jca.common.api.metadata.ds.XaDataSource
   parseXADataSource(XMLStreamReader reader) throws XMLStreamException, ParserException,
      ValidateException
   {
      TransactionIsolation transactionIsolation = null;
      Map<String, String> xaDataSourceProperty = new HashMap<String, String>();
      TimeOut timeOutSettings = null;
      DsSecurity securitySettings = null;
      Statement statementSettings = null;
      Validation validationSettings = null;
View Full Code Here

Examples of org.jboss.jca.common.api.metadata.ds.TransactionIsolation

   {
      String connectionUrl = null;
      String driverClass = null;
      String dataSourceClass = null;
      String driver = null;
      TransactionIsolation transactionIsolation = null;
      Map<String, String> connectionProperties = new HashMap<String, String>();
      TimeOut timeOutSettings = null;
      DsSecurity securitySettings = null;
      Statement statementSettings = null;
      Validation validationSettings = null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.