Proactively abandon any READ holds before closing connection.

@param entityIdentifier the master entity identifier
@return true of abandoned false otherwise
543426
private boolean abandonFetchHolds(String entityIdentifier, boolean healthyConnection) {
    Hold hold = fetchHolds.remove(entityIdentifier);
    return (hold != null) && healthyConnection && silentlyUnlock(hold, entityIdentifier);
  }
990738
private boolean hasEntityBeanInterface(String[] interfaces) {
    for (int i = 0; i < interfaces.length; i++) {
      if (interfaces[i].equals(C_ENTITYBEAN)) {
        return true;
      }
    }
    return false;
  }
1186125
public static PropertyIdentifier getIdentifier(final ConfigDescriptor descriptor)
    {
        checkNotNull(descriptor);
        return new PropertyIdentifierImpl(descriptor.getConfigName(), descriptor.getMethod().getDeclaringClass());
    }
1329006
public function has($entryIdentifier)
    {
        $folder = GeneralUtility::getFileAbsFileName(self::RELATIVE_STORAGE_FOLDER);
        $fileName = $this->getFileName($entryIdentifier);
        if (!\is_file($folder . $fileName)) {
            return false;
        }
        if ($this->freeze) {
            return true;
        }
        $validUntil = (int)\file_get_contents($folder . $fileName . self::FILE_EXTENSION_LIFETIME);

        return $validUntil > \time();
    }
602523
public boolean deleteEntity(Entity entity) {
        String entityName = entity.getName();
        checkEntityIsEmpty(entityName);
        QueryPart<Entity> queryPart = new Query<Entity>("entities")
                .path(entityName, true);
        return httpClientManager.updateMetaData(queryPart, delete());
    }
83583
public void connectionFailed (String ident, boolean readOnly, Connection conn,
                                  SQLException error)
    {
        try {
            conn.close();
        } catch (Exception e) {
            log.warning("Failure closing failed connection",
                        "ident", ident, "ro", readOnly, "conn", conn, e);
        }
    }
687573
boolean scanSpecialIdentifier(String identifier) {

        int length = identifier.length();

        if (limit - currentPosition < length) {
            return false;
        }

        for (int i = 0; i < length; i++) {
            int character = identifier.charAt(i);

            if (character == sqlString.charAt(currentPosition + i)) {
                continue;
            }

            if (character
                    == Character.toUpperCase(sqlString.charAt(currentPosition
                        + i))) {
                continue;
            }

            return false;
        }

        currentPosition += length;

        return true;
    }
326042
@Override
    public final T deserializeInline( final JsonReader reader, final JsonDeserializationContext ctx, JsonDeserializerParameters params,
                                      IdentityDeserializationInfo identityInfo, TypeDeserializationInfo typeInfo, String type,
                                      Map<String, String> bufferedProperties ) {
        final boolean ignoreUnknown = params.isIgnoreUnknown() || isDefaultIgnoreUnknown();
        final Set<String> ignoredProperties;
        if ( null == params.getIgnoredProperties() ) {
            ignoredProperties = defaultIgnoredProperties;
        } else {
            ignoredProperties = new HashSet<String>( defaultIgnoredProperties );
            ignoredProperties.addAll( params.getIgnoredProperties() );
        }

        // we will remove the properties read from this list and check at the end it's empty
        Set<String> requiredPropertiesLeft = requiredProperties.isEmpty() ? Collections
                .<String>emptySet() : new HashSet<String>( requiredProperties );

        // we first look for identity. It can also buffer properties if it is not in current reader position.
        Object id = null;
        Map<String, Object> bufferedPropertiesValues = null;
        if ( null != identityInfo ) {
            JsonReader identityReader = null;

            // we look if it has not been already buffered
            String propertyValue = null;

            // we fisrt look if the identity property has not been read already
            if ( null != bufferedProperties ) {
                propertyValue = bufferedProperties.remove( identityInfo.getPropertyName() );
            }

            if ( null != propertyValue ) {
                identityReader = ctx.newJsonReader( propertyValue );
            } else {
                // we search for the identity property
                while ( JsonToken.NAME.equals( reader.peek() ) ) {
                    String name = reader.nextName();

                    if ( ignoredProperties.contains( name ) ) {
                        reader.skipValue();
                        continue;
                    }

                    if ( identityInfo.getPropertyName().equals( name ) ) {
                        identityReader = reader;
                        break;
                    } else {
                        if ( null == bufferedProperties ) {
                            bufferedProperties = new HashMap<String, String>();
                        }
                        bufferedProperties.put( name, reader.nextValue() );
                    }
                }
            }

            if ( null != identityReader ) {
                if ( identityInfo.isProperty() ) {
                    HasDeserializerAndParameters propertyDeserializer = deserializers.get( identityInfo.getPropertyName() );
                    if ( null == propertyDeserializer ) {
                        // the identity property is defined in constructor
                        propertyDeserializer = instanceBuilder.getParametersDeserializer().get( identityInfo.getPropertyName() );
                        id = propertyDeserializer.getDeserializer().deserialize( identityReader, ctx );
                        bufferedPropertiesValues = new HashMap<String, Object>( 1 );
                        bufferedPropertiesValues.put( identityInfo.getPropertyName(), id );
                    } else {
                        id = propertyDeserializer.getDeserializer().deserialize( identityReader, ctx );
                    }
                } else {
                    id = identityInfo.readId( identityReader, ctx );
                }
            }
        }

        // we first instantiate the bean. It might buffer properties if there are properties required for constructor and they are not in
        // first position
        Instance<T> instance = instanceBuilder.newInstance( reader, ctx, params, bufferedProperties, bufferedPropertiesValues );

        T bean = instance.getInstance();
        bufferedProperties = instance.getBufferedProperties();

        // we save the instance if we have an id
        if ( null != id ) {
            if ( identityInfo.isProperty() ) {
                BeanPropertyDeserializer propertyDeserializer = deserializers.get( identityInfo.getPropertyName() );
                if ( null != propertyDeserializer ) {
                    propertyDeserializer.setValue( bean, id, ctx );
                }
            }
            ctx.addObjectId( identityInfo.newIdKey( id ), bean );
        }

        // we flush any buffered properties
        flushBufferedProperties( bean, bufferedProperties, requiredPropertiesLeft, ctx, ignoreUnknown, ignoredProperties );

        // in case there is a property that need the type info
        if ( null != typeInfo && null != typeInfo.getPropertyName() && null != type ) {
            BeanPropertyDeserializer deserializer = getPropertyDeserializer( typeInfo.getPropertyName(), ctx, true );
            if ( null != deserializer ) {
                deserializer.setValue( bean, type, ctx );
            }
        }

        while ( JsonToken.NAME.equals( reader.peek() ) ) {
            String propertyName = reader.nextName();

            requiredPropertiesLeft.remove( propertyName );

            if ( ignoredProperties.contains( propertyName ) ) {
                reader.skipValue();
                continue;
            }

            BeanPropertyDeserializer<T, ?> property = getPropertyDeserializer( propertyName, ctx, ignoreUnknown );
            if ( null != property ) {
                property.deserialize( reader, bean, ctx );
            } else if ( null != anySetterDeserializer ) {
                anySetterDeserializer.deserialize( reader, bean, propertyName, ctx );
            } else {
                reader.skipValue();
            }
        }

        if ( !requiredPropertiesLeft.isEmpty() ) {
            throw ctx.traceError( "Required properties are missing : " + requiredPropertiesLeft, reader );
        }
        return bean;
    }
1028589
public void setIdentifierResolver(final Object identifierResolver) {
        if (identifierResolver instanceof IdentifierResolver) {
            this.identifierResolver = (IdentifierResolver) identifierResolver;
        } else if (identifierResolver instanceof String) {
            this.identifierResolver = new IdentifierResolver() {
                public String getIdentifierFor(String nodeName) {
                    return (String) identifierResolver;
                }
            };
        } else if (identifierResolver instanceof Closure) {
            final ObjectGraphBuilder self = this;
            this.identifierResolver = new IdentifierResolver() {
                public String getIdentifierFor(String nodeName) {
                    Closure cls = (Closure) identifierResolver;
                    cls.setDelegate(self);
                    return (String) cls.call(new Object[]{nodeName});
                }
            };
        } else {
            this.identifierResolver = new DefaultIdentifierResolver();
        }
    }
314358
@Override
    void closeNoTxEntityManager(JPANoTxEmInvocation noTxInvocation)
    {
        EntityManager em = noTxInvocation.ivEm;
        if (em != null && em.isOpen())
        {
            // Pooling of this entity manager will only be allowed if the getDelegate()
            // method has not been invoked on the entity manager.  If it has then we will
            // need to close it instead.
            if (noTxInvocation.ivAllowPooling) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc, "closeNoTxEntityManager is pooling noTx em: " + em);

                ivEntityManagerPool.putEntityManager(em);
            } else {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc, "closeNoTxEntityManager is closing noTx em: " + em);

                em.close();
            }
        }
    }
740092
public void discardConnection(Connection realConnection) {
        JdbcUtils.close(realConnection);

        lock.lock();
        try {
            activeCount--;
            discardCount++;

            if (activeCount <= 0) {
                emptySignal();
            }
        } finally {
            lock.unlock();
        }
    }
638894
function containsOnlyIdentifiers(node) {
            if (node.type === "Identifier") {
                return true;
            }

            if (node.type === "MemberExpression") {
                if (node.object.type === "Identifier") {
                    return true;
                }
                if (node.object.type === "MemberExpression") {
                    return containsOnlyIdentifiers(node.object);
                }
            }

            return false;
        }
283321
public static void unregisterContextualInstance(EjbDescriptor<?> descriptor) {
        Set<Class<?>> classes = CONTEXTUAL_SESSION_BEANS.get();
        classes.remove(descriptor.getBeanClass());
        if (classes.isEmpty()) {
            CONTEXTUAL_SESSION_BEANS.remove();
        }
    }
1265787
public void setIdentifier(int identifier)
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        "setIdentifier",
                        new Object[] { new Integer(identifier) });

        // We can only set this once. 
        if (objectStoreIdentifier != IDENTIFIER_NOT_SET) {
            InvalidConditionException invalidConditionException = new InvalidConditionException(this
                                                                                                , "objectStoreIdentifier"
                                                                                                , Integer.toString(objectStoreIdentifier) + "not equal IDENTIFIER_NOT_SET"
                            );
            ObjectManager.ffdc.processException(this,
                                                cclass,
                                                "setIdentifier",
                                                invalidConditionException,
                                                "1:623:1.31",
                                                new Object[] { new Integer(objectStoreIdentifier) });
            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                trace.exit(this, cclass
                           , "setIdentifier"
                           , invalidConditionException
                                );
            throw invalidConditionException;
        } // if (objectStoreIdentifier != IDENTIFIER_NOT_SET).
        objectStoreIdentifier = identifier;

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass
                       , "setIdentifier"
                            );
    }
1221265
protected Integer getIdentifierLengthLimit(JdbcEnvironment context) {
        // https://docs.jboss.org/hibernate/orm/5.0/javadocs/org/hibernate/dialect/package-summary.html
        String dialectName = context.getDialect().getClass().getSimpleName();

        if (dialectName.startsWith("Oracle")) {
            // identifier limit of 30 chars -->
            // http://stackoverflow.com/a/756569
            return LENGTH_LIMIT_ORACLE;
        } else if (context.getDialect() instanceof ShogunCoreOracleDialect) {
            // identifier limit of 30 chars -->
            return LENGTH_LIMIT_ORACLE;
        } else if (dialectName.startsWith("PostgreSQL")) {
            // identifier limit of 63 chars -->
            // http://stackoverflow.com/a/8218026
            return LENGTH_LIMIT_POSTGRESQL;
        }
        // H2 has no limit --> http://stackoverflow.com/a/30477403

        return null;
    }
1211145
static String getUserIdentifier(IoSession session) {
        boolean isAcceptor = isAcceptor(session);
        SocketAddress hostPortAddress = isAcceptor ? session.getRemoteAddress() : session.getLocalAddress();
        SocketAddress identityAddress = isAcceptor ? session.getLocalAddress() : session.getRemoteAddress();
        String identity = resolveIdentity(identityAddress, (IoSessionEx)session);
        String hostPort = getHostPort(hostPortAddress);
        return identity == null ? hostPort : format("%s %s", identity, hostPort);
    }
960026
private String readIdentifier() throws IOException {
        StringBuffer sb = new StringBuffer();

        while ((-1 != lastChar) && Character.isLetter((char)lastChar))
        {
            sb.append((char)lastChar);
            readChar();
        }

        return sb.toString();
    }