Skip to content

Commit f7d4bd1

Browse files
committed
Explicit note on connection pool deadlock with REQUIRES_NEW
Closes gh-26250
1 parent 2b48254 commit f7d4bd1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/docs/asciidoc/data-access.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,6 +1993,14 @@ status and with an inner transaction's locks released immediately after its comp
19931993
Such an independent inner transaction can also declare its own isolation level, timeout,
19941994
and read-only settings and not inherit an outer transaction's characteristics.
19951995

1996+
NOTE: The resources attached to the outer transaction will remain bound there while
1997+
the inner transaction acquires its own resources such as a new database connection.
1998+
This may lead to exhaustion of the connection pool and potentially to a deadlock if
1999+
several threads have an active outer transaction and wait to acquire a new connection
2000+
for their inner transaction, with the pool not being able to hand out any such inner
2001+
connection anymore. Do not use `PROPAGATION_REQUIRES_NEW` unless your connection pool
2002+
is appropriately sized, exceeding the number of concurrent threads by at least 1.
2003+
19962004
[[tx-propagation-nested]]
19972005
===== Understanding `PROPAGATION_NESTED`
19982006

0 commit comments

Comments
 (0)