static void attach ( String dbName , Connection connection , String extraInfo ) { if ( ConnectionsAccess . getConnectionMap ( ) . get ( dbName ) != null ) { throw new InternalException ( "You are opening a connection " + dbName + " without closing a previous one. Check your logic. Connection still remains on thread: " + ConnectionsAccess . getConnectionMap ( ) . get ( dbName ) ) ; } ConnectionsAccess . getConnectionMap ( ) . put ( dbName , connection ) ; LogFilter . log ( LOGGER , LogLevel . DEBUG , "Attached connection named: {}: to current thread: {}. Extra info: {}" , dbName , connection , extraInfo ) ; }
Attaches a connection to a ThreadLocal and binds it to a name .