Skip to content

Commit 4c9c2a8

Browse files
yrodiereSanne
authored andcommitted
HHH-14404 Remove check for concurrent execution of LogicalConnectionManagedImpl#releaseConnection
It's unlikely to ever happen, and even if it happened, the resulting exception would probably be rather clear about the fact that the problem is related to concurrent execution (ConcurrentModificationException thrown by a Map of resources, for example). See #3693 (comment) Signed-off-by: Yoann Rodière <[email protected]>
1 parent 8210bc2 commit 4c9c2a8

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

hibernate-core/src/main/java/org/hibernate/resource/jdbc/internal/LogicalConnectionManagedImpl.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,15 +205,7 @@ private void releaseConnection() {
205205
// when releasing resources, we'll abort the batch statement,
206206
// which will trigger "logicalConnection.afterStatement()",
207207
// which in some configurations will release the connection.
208-
209-
//Some managed containers might trigger this release concurrently:
210-
//this is not how they should do things, still we try to detect it to trigger a more clear error.
211-
boolean concurrentUsageDetected = ( this.physicalConnection == null );
212208
this.physicalConnection = null;
213-
if ( concurrentUsageDetected ) {
214-
throw new HibernateException( "Detected concurrent management of connection resources." +
215-
" This might indicate a multi-threaded use of Hibernate in combination with managed resources, which is not supported." );
216-
}
217209
try {
218210
try {
219211
getResourceRegistry().releaseResources();

0 commit comments

Comments
 (0)