document Transaction.setTimeout()

This commit is contained in:
Gavin King 2024-02-06 20:31:46 +01:00
parent ee33347786
commit c8d13108b5

View File

@ -207,6 +207,13 @@ In a container environment, the container itself is usually responsible for mana
In Java EE or Quarkus, you'll probably indicate the boundaries of the transaction using the `@Transactional` annotation. In Java EE or Quarkus, you'll probably indicate the boundaries of the transaction using the `@Transactional` annotation.
**** ****
JPA doesn't have a standard way to set the transaction timeout, but Hibernate does:
[source,java]
----
session.getTransaction().setTimeout(30); // 30 seconds
----
[[persistence-operations]] [[persistence-operations]]
=== Operations on the persistence context === Operations on the persistence context