private void replaceCRI ( WSConnectionRequestInfoImpl newCRI ) throws ResourceException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "replaceCRI" , "Current:" , cri , "New:" , newCRI ) ; if ( numHandlesInUse > 0 || ! cri . isReconfigurable ( newCRI , false ) ) { if ( numHandlesInUse > 0 ) { ResourceException resX = new DataStoreAdapterException ( "WS_INTERNAL_ERROR" , null , getClass ( ) , "ConnectionRequestInfo cannot be changed on a ManagedConnection with active handles." , AdapterUtil . EOLN + "Existing CRI: " + cri , AdapterUtil . EOLN + "Requested CRI: " + newCRI ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "replaceCRI" , resX ) ; throw resX ; } else // Users, passwords, or DataSource configurations do not match. { ResourceException resX = new DataStoreAdapterException ( "WS_INTERNAL_ERROR" , null , getClass ( ) , "ConnectionRequestInfo cannot be changed because the users, passwords, or DataSource configurations do not match." , AdapterUtil . EOLN + "Existing CRI: " + cri , AdapterUtil . EOLN + "Requested CRI: " + newCRI ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "replaceCRI" , resX ) ; throw resX ; } } // The ManagedConnection should use the new CRI value in place of its current CRI. if ( ! newCRI . isCRIChangable ( ) ) newCRI = WSConnectionRequestInfoImpl . createChangableCRIFromNon ( newCRI ) ; newCRI . setDefaultValues ( defaultCatalog , defaultHoldability , defaultReadOnly , defaultTypeMap , defaultSchema , defaultNetworkTimeout ) ; cri = newCRI ; // -- don't intialize the properties, deplay to synchronizePropertiesWithCRI(). if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "replaceCRI" ) ; }
Replace the CRI of this ManagedConnection with the new CRI .