Package org.hibernate

Examples of org.hibernate.MultiTenancyStrategy


    if ( statementFetchSize != null && debugEnabled ) {
      LOG.debugf( "JDBC result set fetch size: %s", statementFetchSize );
    }
    settings.setJdbcFetchSize(statementFetchSize);

    MultiTenancyStrategy multiTenancyStrategy = MultiTenancyStrategy.determineMultiTenancyStrategy( properties );
    if ( debugEnabled ) {
      LOG.debugf( "multi-tenancy strategy : %s", multiTenancyStrategy );
    }
    settings.setMultiTenancyStrategy( multiTenancyStrategy );

    String releaseModeName = ConfigurationHelper.getString( AvailableSettings.RELEASE_CONNECTIONS, properties, "auto" );
    if ( debugEnabled ) {
      LOG.debugf( "Connection release mode: %s", releaseModeName );
    }
    ConnectionReleaseMode releaseMode;
    if ( "auto".equals(releaseModeName) ) {
      releaseMode = serviceRegistry.getService( TransactionFactory.class ).getDefaultReleaseMode();
    }
    else {
      releaseMode = ConnectionReleaseMode.parse( releaseModeName );
      if ( releaseMode == ConnectionReleaseMode.AFTER_STATEMENT ) {
        // we need to make sure the underlying JDBC connection access supports aggressive release...
        boolean supportsAgrressiveRelease = multiTenancyStrategy.requiresMultiTenantConnectionProvider()
            ? serviceRegistry.getService( MultiTenantConnectionProvider.class ).supportsAggressiveRelease()
            : serviceRegistry.getService( ConnectionProvider.class ).supportsAggressiveRelease();
        if ( ! supportsAgrressiveRelease ) {
          LOG.unsupportedAfterStatement();
          releaseMode = ConnectionReleaseMode.AFTER_TRANSACTION;
View Full Code Here


        typeInfoSet
    );
  }

  private JdbcConnectionAccess buildJdbcConnectionAccess(Map configValues) {
    final MultiTenancyStrategy multiTenancyStrategy = MultiTenancyStrategy.determineMultiTenancyStrategy( configValues );

    if ( MultiTenancyStrategy.NONE == multiTenancyStrategy ) {
      connectionProvider = serviceRegistry.getService( ConnectionProvider.class );
      return new ConnectionProviderJdbcConnectionAccess( connectionProvider );
    }
View Full Code Here

    boolean checkNullability = ConfigurationHelper.getBoolean(Environment.CHECK_NULLABILITY, properties, true);
        LOG.debugf( "Check Nullability in Core (should be disabled when Bean Validation is on): %s", enabledDisabled(checkNullability) );
    settings.setCheckNullability(checkNullability);

    MultiTenancyStrategy multiTenancyStrategy = MultiTenancyStrategy.determineMultiTenancyStrategy( properties );
    LOG.debugf( "multi-tenancy strategy : %s", multiTenancyStrategy );
    settings.setMultiTenancyStrategy( multiTenancyStrategy );

    // TODO: Does EntityTuplizerFactory really need to be configurable? revisit for HHH-6383
    settings.setEntityTuplizerFactory( new EntityTuplizerFactory() );
View Full Code Here

    if ( statementFetchSize != null && debugEnabled ) {
      LOG.debugf( "JDBC result set fetch size: %s", statementFetchSize );
    }
    settings.setJdbcFetchSize(statementFetchSize);

    MultiTenancyStrategy multiTenancyStrategy = MultiTenancyStrategy.determineMultiTenancyStrategy( properties );
    if ( debugEnabled ) {
      LOG.debugf( "multi-tenancy strategy : %s", multiTenancyStrategy );
    }
    settings.setMultiTenancyStrategy( multiTenancyStrategy );

    String releaseModeName = ConfigurationHelper.getString( AvailableSettings.RELEASE_CONNECTIONS, properties, "auto" );
    if ( debugEnabled ) {
      LOG.debugf( "Connection release mode: %s", releaseModeName );
    }
    ConnectionReleaseMode releaseMode;
    if ( "auto".equals(releaseModeName) ) {
      releaseMode = serviceRegistry.getService( TransactionFactory.class ).getDefaultReleaseMode();
    }
    else {
      releaseMode = ConnectionReleaseMode.parse( releaseModeName );
      if ( releaseMode == ConnectionReleaseMode.AFTER_STATEMENT ) {
        // we need to make sure the underlying JDBC connection access supports aggressive release...
        boolean supportsAgrressiveRelease = multiTenancyStrategy.requiresMultiTenantConnectionProvider()
            ? serviceRegistry.getService( MultiTenantConnectionProvider.class ).supportsAggressiveRelease()
            : serviceRegistry.getService( ConnectionProvider.class ).supportsAggressiveRelease();
        if ( ! supportsAgrressiveRelease ) {
          LOG.unsupportedAfterStatement();
          releaseMode = ConnectionReleaseMode.AFTER_TRANSACTION;
View Full Code Here

    boolean checkNullability = ConfigurationHelper.getBoolean(Environment.CHECK_NULLABILITY, properties, true);
        LOG.debugf( "Check Nullability in Core (should be disabled when Bean Validation is on): %s", enabledDisabled(checkNullability) );
    settings.setCheckNullability(checkNullability);

    MultiTenancyStrategy multiTenancyStrategy = MultiTenancyStrategy.determineMultiTenancyStrategy( properties );
    LOG.debugf( "multi-tenancy strategy : %s", multiTenancyStrategy );
    settings.setMultiTenancyStrategy( multiTenancyStrategy );

//    String provider = properties.getProperty( Environment.BYTECODE_PROVIDER );
//    log.info( "Bytecode provider name : " + provider );
View Full Code Here

    if ( debugEnabled ) {
      LOG.debugf( "Check Nullability in Core (should be disabled when Bean Validation is on): %s", enabledDisabled(checkNullability) );
    }
    settings.setCheckNullability(checkNullability);

    MultiTenancyStrategy multiTenancyStrategy = MultiTenancyStrategy.determineMultiTenancyStrategy( properties );
    if ( debugEnabled ) {
      LOG.debugf( "multi-tenancy strategy : %s", multiTenancyStrategy );
    }
    settings.setMultiTenancyStrategy( multiTenancyStrategy );
View Full Code Here

TOP

Related Classes of org.hibernate.MultiTenancyStrategy

Copyright © 2018 www.massapicom. 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.