Class ConnectionLockTimeoutOperations
java.lang.Object
org.hibernate.dialect.lock.spi.ConnectionLockTimeoutOperations
@Incubating(since="7.1",
group="dialect-locking")
@SPI(USE)
public final class ConnectionLockTimeoutOperations
extends Object
Executes the common JDBC operations used by connection-level lock-timeout strategies.
These operations integrate with Hibernate's SQL statement logger, statement
observer, resource handling, and SQL exception conversion. A provider-owned
ConnectionLockTimeoutStrategy should use them instead of depending on the
corresponding internal helper.
- Since:
- 8.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceExtracts a timeout from the current row of a JDBC result set. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidexecute(int value, String sqlFormat, Connection connection, SessionFactoryImplementor factory) Formats one integral value into a command and executes it.static voidexecute(Timeout timeout, ToIntFunction<Timeout> valueResolver, String sqlFormat, Connection connection, SessionFactoryImplementor factory) Converts a timeout to one integral database value, formats it into a command, and executes the command.static voidexecute(String sql, Connection connection, SessionFactoryImplementor factory) Executes a complete connection-level lock-timeout command.static Timeoutquery(String sql, ConnectionLockTimeoutOperations.TimeoutExtractor extractor, Connection connection, SessionFactoryImplementor factory) Queries the current timeout and extracts it from the first result row.
-
Method Details
-
query
public static Timeout query(String sql, ConnectionLockTimeoutOperations.TimeoutExtractor extractor, Connection connection, SessionFactoryImplementor factory) Queries the current timeout and extracts it from the first result row. -
execute
Executes a complete connection-level lock-timeout command. -
execute
public static void execute(int value, String sqlFormat, Connection connection, SessionFactoryImplementor factory) Formats one integral value into a command and executes it. -
execute
public static void execute(Timeout timeout, ToIntFunction<Timeout> valueResolver, String sqlFormat, Connection connection, SessionFactoryImplementor factory) Converts a timeout to one integral database value, formats it into a command, and executes the command.
-