Java 类org.hibernate.dialect.lock.LockingStrategy 实例源码

项目:lams    文件:HSQLDialect.java   
/**
 * For HSQLDB 2.0, this is a copy of the base class implementation.
 * For HSQLDB 1.8, only READ_UNCOMMITTED is supported.
 * <p/>
 * {@inheritDoc}
 */
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    if ( lockMode == LockMode.PESSIMISTIC_FORCE_INCREMENT ) {
        return new PessimisticForceIncrementLockingStrategy( lockable, lockMode );
    }
    else if ( lockMode == LockMode.PESSIMISTIC_WRITE ) {
        return new PessimisticWriteSelectLockingStrategy( lockable, lockMode );
    }
    else if ( lockMode == LockMode.PESSIMISTIC_READ ) {
        return new PessimisticReadSelectLockingStrategy( lockable, lockMode );
    }
    else if ( lockMode == LockMode.OPTIMISTIC ) {
        return new OptimisticLockingStrategy( lockable, lockMode );
    }
    else if ( lockMode == LockMode.OPTIMISTIC_FORCE_INCREMENT ) {
        return new OptimisticForceIncrementLockingStrategy( lockable, lockMode );
    }

    if ( hsqldbVersion < 20 ) {
        return new ReadUncommittedLockingStrategy( lockable, lockMode );
    }
    else {
        return new SelectLockingStrategy( lockable, lockMode );
    }
}
项目:lams    文件:Cache71Dialect.java   
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    // InterSystems Cache' does not current support "SELECT ... FOR UPDATE" syntax...
    // Set your transaction mode to READ_COMMITTED before using
    if ( lockMode==LockMode.PESSIMISTIC_FORCE_INCREMENT) {
        return new PessimisticForceIncrementLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode==LockMode.PESSIMISTIC_WRITE) {
        return new PessimisticWriteUpdateLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode==LockMode.PESSIMISTIC_READ) {
        return new PessimisticReadUpdateLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode==LockMode.OPTIMISTIC) {
        return new OptimisticLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode==LockMode.OPTIMISTIC_FORCE_INCREMENT) {
        return new OptimisticForceIncrementLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode.greaterThan( LockMode.READ ) ) {
        return new UpdateLockingStrategy( lockable, lockMode );
    }
    else {
        return new SelectLockingStrategy( lockable, lockMode );
    }
}
项目:lams    文件:TimesTenDialect.java   
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    // TimesTen has no known variation of a "SELECT ... FOR UPDATE" syntax...
    if ( lockMode == LockMode.PESSIMISTIC_FORCE_INCREMENT ) {
        return new PessimisticForceIncrementLockingStrategy( lockable, lockMode );
    }
    else if ( lockMode == LockMode.PESSIMISTIC_WRITE ) {
        return new PessimisticWriteUpdateLockingStrategy( lockable, lockMode );
    }
    else if ( lockMode == LockMode.PESSIMISTIC_READ ) {
        return new PessimisticReadUpdateLockingStrategy( lockable, lockMode );
    }
    else if ( lockMode == LockMode.OPTIMISTIC ) {
        return new OptimisticLockingStrategy( lockable, lockMode );
    }
    else if ( lockMode == LockMode.OPTIMISTIC_FORCE_INCREMENT ) {
        return new OptimisticForceIncrementLockingStrategy( lockable, lockMode );
    }
    else if ( lockMode.greaterThan( LockMode.READ ) ) {
        return new UpdateLockingStrategy( lockable, lockMode );
    }
    else {
        return new SelectLockingStrategy( lockable, lockMode );
    }
}
项目:lams    文件:PointbaseDialect.java   
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    // Pointbase has no known variation of a "SELECT ... FOR UPDATE" syntax...
    if ( lockMode==LockMode.PESSIMISTIC_FORCE_INCREMENT) {
        return new PessimisticForceIncrementLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode==LockMode.PESSIMISTIC_WRITE) {
        return new PessimisticWriteUpdateLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode==LockMode.PESSIMISTIC_READ) {
        return new PessimisticReadUpdateLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode==LockMode.OPTIMISTIC) {
        return new OptimisticLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode==LockMode.OPTIMISTIC_FORCE_INCREMENT) {
        return new OptimisticForceIncrementLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode.greaterThan( LockMode.READ ) ) {
        return new UpdateLockingStrategy( lockable, lockMode );
    }
    else {
        return new SelectLockingStrategy( lockable, lockMode );
    }
}
项目:lams    文件:RDMSOS2200Dialect.java   
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    // RDMS has no known variation of a "SELECT ... FOR UPDATE" syntax...
    if ( lockMode == LockMode.PESSIMISTIC_FORCE_INCREMENT ) {
        return new PessimisticForceIncrementLockingStrategy( lockable, lockMode );
    }
    else if ( lockMode == LockMode.PESSIMISTIC_WRITE ) {
        return new PessimisticWriteUpdateLockingStrategy( lockable, lockMode );
    }
    else if ( lockMode == LockMode.PESSIMISTIC_READ ) {
        return new PessimisticReadUpdateLockingStrategy( lockable, lockMode );
    }
    else if ( lockMode == LockMode.OPTIMISTIC ) {
        return new OptimisticLockingStrategy( lockable, lockMode );
    }
    else if ( lockMode == LockMode.OPTIMISTIC_FORCE_INCREMENT ) {
        return new OptimisticForceIncrementLockingStrategy( lockable, lockMode );
    }
    else if ( lockMode.greaterThan( LockMode.READ ) ) {
        return new UpdateLockingStrategy( lockable, lockMode );
    }
    else {
        return new SelectLockingStrategy( lockable, lockMode );
    }
}
项目:lams    文件:MckoiDialect.java   
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    // Mckoi has no known variation of a "SELECT ... FOR UPDATE" syntax...
    if ( lockMode==LockMode.PESSIMISTIC_FORCE_INCREMENT) {
        return new PessimisticForceIncrementLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode==LockMode.PESSIMISTIC_WRITE) {
        return new PessimisticWriteUpdateLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode==LockMode.PESSIMISTIC_READ) {
        return new PessimisticReadUpdateLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode==LockMode.OPTIMISTIC) {
        return new OptimisticLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode==LockMode.OPTIMISTIC_FORCE_INCREMENT) {
        return new OptimisticForceIncrementLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode.greaterThan( LockMode.READ ) ) {
        return new UpdateLockingStrategy( lockable, lockMode );
    }
    else {
        return new SelectLockingStrategy( lockable, lockMode );
    }
}
项目:lams    文件:Dialect.java   
/**
 * Get a strategy instance which knows how to acquire a database-level lock
 * of the specified mode for this dialect.
 *
 * @param lockable The persister for the entity to be locked.
 * @param lockMode The type of lock to be acquired.
 * @return The appropriate locking strategy.
 * @since 3.2
 */
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    switch ( lockMode ) {
        case PESSIMISTIC_FORCE_INCREMENT:
            return new PessimisticForceIncrementLockingStrategy( lockable, lockMode );
        case PESSIMISTIC_WRITE:
            return new PessimisticWriteSelectLockingStrategy( lockable, lockMode );
        case PESSIMISTIC_READ:
            return new PessimisticReadSelectLockingStrategy( lockable, lockMode );
        case OPTIMISTIC:
            return new OptimisticLockingStrategy( lockable, lockMode );
        case OPTIMISTIC_FORCE_INCREMENT:
            return new OptimisticForceIncrementLockingStrategy( lockable, lockMode );
        default:
            return new SelectLockingStrategy( lockable, lockMode );
    }
}
项目:lams    文件:FrontBaseDialect.java   
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    // Frontbase has no known variation of a "SELECT ... FOR UPDATE" syntax...
    if ( lockMode==LockMode.PESSIMISTIC_FORCE_INCREMENT) {
        return new PessimisticForceIncrementLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode==LockMode.PESSIMISTIC_WRITE) {
        return new PessimisticWriteUpdateLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode==LockMode.PESSIMISTIC_READ) {
        return new PessimisticReadUpdateLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode==LockMode.OPTIMISTIC) {
        return new OptimisticLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode==LockMode.OPTIMISTIC_FORCE_INCREMENT) {
        return new OptimisticForceIncrementLockingStrategy( lockable, lockMode);
    }
    else if ( lockMode.greaterThan( LockMode.READ ) ) {
        return new UpdateLockingStrategy( lockable, lockMode );
    }
    else {
        return new SelectLockingStrategy( lockable, lockMode );
    }
}
项目:hibernate-ogm-ignite    文件:IgniteDialect.java   
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    if ( lockMode == LockMode.PESSIMISTIC_FORCE_INCREMENT ) {
        return new PessimisticForceIncrementLockingStrategy( lockable, lockMode );
    }
    // else if ( lockMode==LockMode.PESSIMISTIC_WRITE ) {
    // return new PessimisticWriteLockingStrategy( lockable, lockMode );
    // }
    else if ( lockMode == LockMode.PESSIMISTIC_READ ) {
        return new IgnitePessimisticReadLockingStrategy( lockable, lockMode, provider );
    }
    else if ( lockMode == LockMode.OPTIMISTIC ) {
        return new OptimisticLockingStrategy( lockable, lockMode );
    }
    else if ( lockMode == LockMode.OPTIMISTIC_FORCE_INCREMENT ) {
        return new OptimisticForceIncrementLockingStrategy( lockable, lockMode );
    }
    else {
        return null;
    }
}
项目:cacheonix-core    文件:Cache71Dialect.java   
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    // InterSystems Cache' does not current support "SELECT ... FOR UPDATE" syntax...
    // Set your transaction mode to READ_COMMITTED before using
    if ( lockMode.greaterThan( LockMode.READ ) ) {
        return new UpdateLockingStrategy( lockable, lockMode );
    }
    else {
        return new SelectLockingStrategy( lockable, lockMode );
    }
}
项目:cacheonix-core    文件:TimesTenDialect.java   
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    // TimesTen has no known variation of a "SELECT ... FOR UPDATE" syntax...
    if ( lockMode.greaterThan( LockMode.READ ) ) {
        return new UpdateLockingStrategy( lockable, lockMode );
    }
    else {
        return new SelectLockingStrategy( lockable, lockMode );
    }
}
项目:cacheonix-core    文件:PointbaseDialect.java   
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    // Pointbase has no known variation of a "SELECT ... FOR UPDATE" syntax...
    if ( lockMode.greaterThan( LockMode.READ ) ) {
        return new UpdateLockingStrategy( lockable, lockMode );
    }
    else {
        return new SelectLockingStrategy( lockable, lockMode );
    }
}
项目:cacheonix-core    文件:RDMSOS2200Dialect.java   
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    // RDMS has no known variation of a "SELECT ... FOR UPDATE" syntax...
    if ( lockMode.greaterThan( LockMode.READ ) ) {
        return new UpdateLockingStrategy( lockable, lockMode );
    }
    else {
        return new SelectLockingStrategy( lockable, lockMode );
    }
}
项目:cacheonix-core    文件:MckoiDialect.java   
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    // Mckoi has no known variation of a "SELECT ... FOR UPDATE" syntax...
    if ( lockMode.greaterThan( LockMode.READ ) ) {
        return new UpdateLockingStrategy( lockable, lockMode );
    }
    else {
        return new SelectLockingStrategy( lockable, lockMode );
    }
}
项目:cacheonix-core    文件:FrontBaseDialect.java   
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    // Frontbase has no known variation of a "SELECT ... FOR UPDATE" syntax...
    if ( lockMode.greaterThan( LockMode.READ ) ) {
        return new UpdateLockingStrategy( lockable, lockMode );
    }
    else {
        return new SelectLockingStrategy( lockable, lockMode );
    }
}
项目:lams    文件:AbstractEntityPersister.java   
protected LockingStrategy generateLocker(LockMode lockMode) {
    return factory.getDialect().getLockingStrategy( this, lockMode );
}
项目:lams    文件:AbstractEntityPersister.java   
private LockingStrategy getLocker(LockMode lockMode) {
    return ( LockingStrategy ) lockers.get( lockMode );
}
项目:cacheonix-core    文件:AbstractEntityPersister.java   
protected LockingStrategy generateLocker(LockMode lockMode) {
    return factory.getDialect().getLockingStrategy( this, lockMode );
}
项目:cacheonix-core    文件:AbstractEntityPersister.java   
private LockingStrategy getLocker(LockMode lockMode) {
    return ( LockingStrategy ) lockers.get( lockMode );
}
项目:cacheonix-core    文件:HSQLDialect.java   
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    // HSQLDB only supports READ_UNCOMMITTED transaction isolation
    return new ReadUncommittedLockingStrategy( lockable, lockMode );
}
项目:lightblue-hibernate-ogm    文件:LightblueDialect.java   
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    return null; // lightblue does not support locking
}
项目:org.fastnate    文件:AllowMissingIdentitySupportDialect.java   
@Override
public LockingStrategy getLockingStrategy(final Lockable lockable, final LockMode lockMode) {
    return this.wrapped.getLockingStrategy(lockable, lockMode);
}
项目:debop4j    文件:RedisDialect.java   
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    // TODO: Redis 의 Locking 기능을 조사해보자.
    throw new RuntimeException("the lock is not supported yet.");
}
项目:debop4j    文件:DatastoreProviderGeneratingSchema.java   
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    return null;  //To change body of implemented methods use File | Settings | File Templates.
}
项目:OpenDiabetes    文件:HSQLDialect.java   
/**
        * For HSQLDB 2.0, this is a copy of the base class implementation.
        * For HSQLDB 1.8, only READ_UNCOMMITTED is supported.
        *
        * @param lockable The persister for the entity to be locked.
        * @param lockMode The type of lock to be acquired.
        *
        * @return The appropriate locking strategy.
        *
        * @since 3.2
        */
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
               if ( hsqldbVersion < 20 ) {
    return new ReadUncommittedLockingStrategy( lockable, lockMode );
}
               else {
                       return new SelectLockingStrategy( lockable, lockMode );
               }
       }
项目:dev-courses    文件:HSQLDialect.java   
/**
        * For HSQLDB 2.0, this is a copy of the base class implementation.
        * For HSQLDB 1.8, only READ_UNCOMMITTED is supported.
        *
        * @param lockable The persister for the entity to be locked.
        * @param lockMode The type of lock to be acquired.
        *
        * @return The appropriate locking strategy.
        *
        * @since 3.2
        */
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
               if ( hsqldbVersion < 20 ) {
    return new ReadUncommittedLockingStrategy( lockable, lockMode );
}
               else {
                       return new SelectLockingStrategy( lockable, lockMode );
               }
       }
项目:Pegasus    文件:HSQLDialect.java   
/**
        * For HSQLDB 2.0, this is a copy of the base class implementation.
        * For HSQLDB 1.8, only READ_UNCOMMITTED is supported.
        *
        * @param lockable The persister for the entity to be locked.
        * @param lockMode The type of lock to be acquired.
        *
        * @return The appropriate locking strategy.
        *
        * @since 3.2
        */
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
               if ( hsqldbVersion < 20 ) {
    return new ReadUncommittedLockingStrategy( lockable, lockMode );
}
               else {
                       return new SelectLockingStrategy( lockable, lockMode );
               }
       }
项目:cacheonix-core    文件:Dialect.java   
/**
 * Get a strategy instance which knows how to acquire a database-level lock
 * of the specified mode for this dialect.
 *
 * @param lockable The persister for the entity to be locked.
 * @param lockMode The type of lock to be acquired.
 * @return The appropriate locking strategy.
 * @since 3.2
 */
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
    return new SelectLockingStrategy( lockable, lockMode );
}