+ // Final sanity check to make sure the right domain is selected
+ if ( !$domainInstance->isCompatible( $conn->getDomainID() ) ) {
+ throw new UnexpectedValueException(
+ "Got connection to '{$conn->getDomainID()}', but expected '$domain'." );
+ }
+ // Increment reference count