4
4
*/
5
5
package org .hibernate .community .dialect .lock .internal ;
6
6
7
- import jakarta .persistence .Timeout ;
8
7
import org .hibernate .dialect .RowLockStrategy ;
9
8
import org .hibernate .dialect .lock .spi .ConnectionLockTimeoutStrategy ;
10
- import org .hibernate .dialect .lock .spi .LockTimeoutType ;
11
9
import org .hibernate .dialect .lock .spi .LockingSupport ;
12
10
import org .hibernate .dialect .lock .spi .OuterJoinLockingType ;
13
11
14
12
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 ;
19
13
20
14
/**
21
15
* @author chen zhida
24
18
*/
25
19
public class GaussDBLockingSupport implements LockingSupport , LockingSupport .Metadata , ConnectionLockTimeoutStrategy {
26
20
public static final LockingSupport LOCKING_SUPPORT = new GaussDBLockingSupport ();
27
- private final boolean supportsNoWait ;
28
- private final boolean supportsSkipLocked ;
29
21
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
- }
38
22
39
23
@ Override
40
24
public Metadata getMetadata () {
@@ -46,17 +30,6 @@ public RowLockStrategy getWriteRowLockStrategy() {
46
30
return RowLockStrategy .TABLE ;
47
31
}
48
32
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
-
60
33
@ Override
61
34
public OuterJoinLockingType getOuterJoinLockingType () {
62
35
return OuterJoinLockingType .UNSUPPORTED ;
0 commit comments