mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-08 20:24:46 +00:00
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 https://github.com/hibernate/hibernate-orm/pull/3693#discussion_r560393293 Signed-off-by: Yoann Rodière <yoann@hibernate.org>
This commit is contained in:
parent
afd3758823
commit
5c86f12675
@ -205,15 +205,7 @@ private void releaseConnection() {
|
||||
// when releasing resources, we'll abort the batch statement,
|
||||
// which will trigger "logicalConnection.afterStatement()",
|
||||
// which in some configurations will release the connection.
|
||||
|
||||
//Some managed containers might trigger this release concurrently:
|
||||
//this is not how they should do things, still we try to detect it to trigger a more clear error.
|
||||
boolean concurrentUsageDetected = ( this.physicalConnection == null );
|
||||
this.physicalConnection = null;
|
||||
if ( concurrentUsageDetected ) {
|
||||
throw new HibernateException( "Detected concurrent management of connection resources." +
|
||||
" This might indicate a multi-threaded use of Hibernate in combination with managed resources, which is not supported." );
|
||||
}
|
||||
try {
|
||||
try {
|
||||
getResourceRegistry().releaseResources();
|
||||
|
Loading…
x
Reference in New Issue
Block a user