|
227 | 227 | import static org.hibernate.internal.util.StringHelper.splitAtCommas;
|
228 | 228 | import static org.hibernate.internal.util.collections.ArrayHelper.EMPTY_STRING_ARRAY;
|
229 | 229 | import static org.hibernate.sql.ast.internal.NonLockingClauseStrategy.NON_CLAUSE_STRATEGY;
|
230 |
| -import static org.hibernate.type.SqlTypes.*; |
| 230 | +import static org.hibernate.type.SqlTypes.ARRAY; |
| 231 | +import static org.hibernate.type.SqlTypes.BIGINT; |
| 232 | +import static org.hibernate.type.SqlTypes.BINARY; |
| 233 | +import static org.hibernate.type.SqlTypes.BLOB; |
| 234 | +import static org.hibernate.type.SqlTypes.BOOLEAN; |
| 235 | +import static org.hibernate.type.SqlTypes.CHAR; |
| 236 | +import static org.hibernate.type.SqlTypes.CLOB; |
| 237 | +import static org.hibernate.type.SqlTypes.DATE; |
| 238 | +import static org.hibernate.type.SqlTypes.DECIMAL; |
| 239 | +import static org.hibernate.type.SqlTypes.DOUBLE; |
| 240 | +import static org.hibernate.type.SqlTypes.FLOAT; |
| 241 | +import static org.hibernate.type.SqlTypes.INTEGER; |
| 242 | +import static org.hibernate.type.SqlTypes.LONG32NVARCHAR; |
| 243 | +import static org.hibernate.type.SqlTypes.LONG32VARBINARY; |
| 244 | +import static org.hibernate.type.SqlTypes.LONG32VARCHAR; |
| 245 | +import static org.hibernate.type.SqlTypes.NCHAR; |
| 246 | +import static org.hibernate.type.SqlTypes.NCLOB; |
| 247 | +import static org.hibernate.type.SqlTypes.NUMERIC; |
| 248 | +import static org.hibernate.type.SqlTypes.NVARCHAR; |
| 249 | +import static org.hibernate.type.SqlTypes.REAL; |
| 250 | +import static org.hibernate.type.SqlTypes.ROWID; |
| 251 | +import static org.hibernate.type.SqlTypes.SMALLINT; |
| 252 | +import static org.hibernate.type.SqlTypes.TIME; |
| 253 | +import static org.hibernate.type.SqlTypes.TIMESTAMP; |
| 254 | +import static org.hibernate.type.SqlTypes.TIMESTAMP_UTC; |
| 255 | +import static org.hibernate.type.SqlTypes.TIMESTAMP_WITH_TIMEZONE; |
| 256 | +import static org.hibernate.type.SqlTypes.TIME_UTC; |
| 257 | +import static org.hibernate.type.SqlTypes.TIME_WITH_TIMEZONE; |
| 258 | +import static org.hibernate.type.SqlTypes.TINYINT; |
| 259 | +import static org.hibernate.type.SqlTypes.VARBINARY; |
| 260 | +import static org.hibernate.type.SqlTypes.VARCHAR; |
| 261 | +import static org.hibernate.type.SqlTypes.isCharacterType; |
| 262 | +import static org.hibernate.type.SqlTypes.isEnumType; |
| 263 | +import static org.hibernate.type.SqlTypes.isFloatOrRealOrDouble; |
| 264 | +import static org.hibernate.type.SqlTypes.isIntegral; |
| 265 | +import static org.hibernate.type.SqlTypes.isNumericOrDecimal; |
| 266 | +import static org.hibernate.type.SqlTypes.isVarbinaryType; |
| 267 | +import static org.hibernate.type.SqlTypes.isVarcharType; |
231 | 268 | import static org.hibernate.type.descriptor.DateTimeUtils.JDBC_ESCAPE_END;
|
232 | 269 | import static org.hibernate.type.descriptor.DateTimeUtils.JDBC_ESCAPE_START_DATE;
|
233 | 270 | import static org.hibernate.type.descriptor.DateTimeUtils.JDBC_ESCAPE_START_TIME;
|
@@ -2682,19 +2719,21 @@ public void setLockTimeout(Timeout timeout, Connection connection, SessionFactor
|
2682 | 2719 | throw new UnsupportedOperationException( "Lock timeout on the JDBC connection is not supported for " + getClass().getSimpleName() );
|
2683 | 2720 | }
|
2684 | 2721 |
|
| 2722 | + private static final Timeout TESTER_TIMEOUT = Timeout.milliseconds( 2000 ); |
| 2723 | + |
2685 | 2724 | /**
|
2686 | 2725 | * Whether this dialect supports specifying timeouts when requesting locks.
|
2687 | 2726 | *
|
| 2727 | + * @return True if this dialect supports specifying lock timeouts. |
| 2728 | + * |
2688 | 2729 | * @apiNote Specifically, we are interested here in whether the Dialect supports
|
2689 | 2730 | * requesting a lock timeout as part of the {@linkplain LockTimeoutStyle#QUERY SQL query}.
|
2690 | 2731 | *
|
2691 |
| - * @return True if this dialect supports specifying lock timeouts. |
2692 |
| - * |
2693 | 2732 | * @deprecated Use {@linkplain #getLockTimeoutStyle(Timeout)} instead.
|
2694 | 2733 | */
|
2695 | 2734 | @Deprecated
|
2696 | 2735 | public boolean supportsLockTimeouts() {
|
2697 |
| - return getLockTimeoutStyle( Timeouts.WAIT_FOREVER ) == LockTimeoutStyle.QUERY; |
| 2736 | + return getLockTimeoutStyle( TESTER_TIMEOUT ) == LockTimeoutStyle.QUERY; |
2698 | 2737 | }
|
2699 | 2738 |
|
2700 | 2739 | /**
|
|
0 commit comments