Cacheable cachedItem = statementCache.find(statement);
CachedStatement cs = (CachedStatement) cachedItem;
GenericPreparedStatement ps = cs.getPreparedStatement();
synchronized (ps) {
if (ps.upToDate()) {
GeneratedClass ac = ps.getActivationClass();
// Check to see if the statement was prepared before some change
// in the class loading set. If this is the case then force it to be invalid
int currentClasses =
getLanguageConnectionFactory().getClassFactory().getClassLoaderVersion();
if (ac.getClassLoaderVersion() != currentClasses) {
ps.makeInvalid(DependencyManager.INTERNAL_RECOMPILE_REQUEST, this);
}
// note that the PreparedStatement is not kept in the cache. This is because
// having items kept in the cache that ultimately are held onto by
// user code is impossible to manage. E.g. an open ResultSet would hold onto