HHH-16541 Don't report supportsSkipLocked() for Sybase
This commit is contained in:
parent
8fcd3a1f54
commit
bee160e9f2
|
@ -592,13 +592,14 @@ public class SybaseASELegacyDialect extends SybaseLegacyDialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsSkipLocked() {
|
||||
return true;
|
||||
// It does support skipping locked rows only for READ locking
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String appendLockHint(LockOptions mode, String tableName) {
|
||||
final String lockHint = super.appendLockHint( mode, tableName );
|
||||
return mode.getLockMode() == LockMode.UPGRADE_SKIPLOCKED || mode.getTimeOut() == LockOptions.SKIP_LOCKED
|
||||
return !mode.getLockMode().greaterThan( LockMode.READ ) && mode.getTimeOut() == LockOptions.SKIP_LOCKED
|
||||
? lockHint + " readpast"
|
||||
: lockHint;
|
||||
}
|
||||
|
|
|
@ -594,13 +594,14 @@ public class SybaseASEDialect extends SybaseDialect {
|
|||
|
||||
@Override
|
||||
public boolean supportsSkipLocked() {
|
||||
return true;
|
||||
// It does support skipping locked rows only for READ locking
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String appendLockHint(LockOptions mode, String tableName) {
|
||||
final String lockHint = super.appendLockHint( mode, tableName );
|
||||
return mode.getLockMode() == LockMode.UPGRADE_SKIPLOCKED || mode.getTimeOut() == LockOptions.SKIP_LOCKED
|
||||
return !mode.getLockMode().greaterThan( LockMode.READ ) && mode.getTimeOut() == LockOptions.SKIP_LOCKED
|
||||
? lockHint + " readpast"
|
||||
: lockHint;
|
||||
}
|
||||
|
|
|
@ -282,7 +282,7 @@ public class LockTest extends BaseEntityManagerFunctionalTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
@RequiresDialectFeature( value = DialectChecks.SupportSkipLocked.class )
|
||||
@RequiresDialectFeature( value = DialectChecks.SupportsSkipLocked.class )
|
||||
@SkipForDialect(value = CockroachDialect.class, comment = "for update clause does not imply locking. See https://github.com/cockroachdb/cockroach/issues/88995")
|
||||
public void testUpdateWithPessimisticReadLockSkipLocked() {
|
||||
Lock lock = new Lock();
|
||||
|
|
|
@ -198,12 +198,6 @@ abstract public class DialectChecks {
|
|||
}
|
||||
}
|
||||
|
||||
public static class SupportSkipLocked implements DialectCheck {
|
||||
public boolean isMatch(Dialect dialect) {
|
||||
return dialect.supportsSkipLocked();
|
||||
}
|
||||
}
|
||||
|
||||
public static class SupportNoWait implements DialectCheck {
|
||||
public boolean isMatch(Dialect dialect) {
|
||||
return dialect.supportsNoWait();
|
||||
|
|
Loading…
Reference in New Issue