Skip to content

Commit b505d6c

Browse files
SweetWuXiaoMeibeikov
authored andcommitted
HHH-19652 - GaussDB locking support
1 parent eed1cf1 commit b505d6c

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/lock/internal/GaussDBLockingSupport.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,12 @@
44
*/
55
package org.hibernate.community.dialect.lock.internal;
66

7-
import jakarta.persistence.Timeout;
87
import org.hibernate.dialect.RowLockStrategy;
98
import org.hibernate.dialect.lock.spi.ConnectionLockTimeoutStrategy;
10-
import org.hibernate.dialect.lock.spi.LockTimeoutType;
119
import org.hibernate.dialect.lock.spi.LockingSupport;
1210
import org.hibernate.dialect.lock.spi.OuterJoinLockingType;
1311

1412

15-
import static org.hibernate.Timeouts.NO_WAIT_MILLI;
16-
import static org.hibernate.Timeouts.SKIP_LOCKED_MILLI;
17-
import static org.hibernate.Timeouts.WAIT_FOREVER_MILLI;
18-
import static org.hibernate.dialect.lock.spi.LockTimeoutType.QUERY;
1913

2014
/**
2115
* @author chen zhida
@@ -24,17 +18,7 @@
2418
*/
2519
public class GaussDBLockingSupport implements LockingSupport, LockingSupport.Metadata, ConnectionLockTimeoutStrategy {
2620
public static final LockingSupport LOCKING_SUPPORT = new GaussDBLockingSupport();
27-
private final boolean supportsNoWait;
28-
private final boolean supportsSkipLocked;
2921

30-
public GaussDBLockingSupport() {
31-
this( true, true );
32-
}
33-
34-
public GaussDBLockingSupport(boolean supportsNoWait, boolean supportsSkipLocked) {
35-
this.supportsNoWait = supportsNoWait;
36-
this.supportsSkipLocked = supportsSkipLocked;
37-
}
3822

3923
@Override
4024
public Metadata getMetadata() {
@@ -46,17 +30,6 @@ public RowLockStrategy getWriteRowLockStrategy() {
4630
return RowLockStrategy.TABLE;
4731
}
4832

49-
@Override
50-
public LockTimeoutType getLockTimeoutType(Timeout timeout) {
51-
return switch ( timeout.milliseconds() ) {
52-
case NO_WAIT_MILLI -> supportsNoWait ? QUERY : LockTimeoutType.NONE;
53-
case SKIP_LOCKED_MILLI -> supportsSkipLocked ? QUERY : LockTimeoutType.NONE;
54-
case WAIT_FOREVER_MILLI -> LockTimeoutType.NONE;
55-
// we can apply a timeout via the connection
56-
default -> LockTimeoutType.CONNECTION;
57-
};
58-
}
59-
6033
@Override
6134
public OuterJoinLockingType getOuterJoinLockingType() {
6235
return OuterJoinLockingType.UNSUPPORTED;

0 commit comments

Comments
 (0)