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