[Geoserver-devel] [JIRA] (GEOS-10022) JDBCConfig's ConfigDatabase save() and remove() leave objects in internal cache

Gabriel Roldan created an issue

GeoServer / BugGEOS-10022

JDBCConfig’s ConfigDatabase save() and remove() leave objects in internal cache

Issue Type:

BugBug

Assignee:

Unassigned

Components:

JDBCConfig

Created:

15/Apr/21 6:25 PM

Priority:

MediumMedium

Reporter:

Gabriel Roldan

I don’t have time for a PR now, but had to to the following in geoserver-cloud, where there’s a full catalog conformance test:

    /**
     * Override to dispose the internal cache for both the {@link ModificationProxy} wrapped object
     * (as it may contain identity references to other objects) and the provided {@code info} (which
     * can contain new references to other objects like workspace)
     */
    @Override
    @Transactional(transactionManager = "jdbcConfigTransactionManager",
            propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public <T extends Info> T save(T info) {
        clearCache(ModificationProxy.unwrap(info));
        T saved = super.save(info);
        clearCache(saved);
        return saved;
    }

    /**
     * Override to dispose the internal cache for both the {@link ModificationProxy} wrapped object
     */
    @Override
    @Transactional(transactionManager = "jdbcConfigTransactionManager",
            propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public void remove(Info info) {
        clearCache(ModificationProxy.unwrap(info));
        super.remove(info);
    }

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100157-sha1:a51b698)

Atlassian logo