Skip to content

Commit

Permalink
[issue-229] do not persist legacy property-backed-beans from legacy p…
Browse files Browse the repository at this point in the history
…ropertybackedbeans on init

This fix prevents property-backed-beans configuration being persisted at init.
This mitigates issues where breaking configuration is duplicated in the database,
ensuring that simple removal of the broken configuration allows for startup.
  • Loading branch information
RVanhuysseXenit authored and AFaust committed Nov 20, 2024
1 parent 1deb645 commit 98964e3
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,21 @@ protected void handleNewPropertyBackedBean(final PropertyBackedBean propertyBack

// for some reason most subsystem beans are by default not configured to broadcast property changes
// JMX only works because it is the only tool / component dealing with this, and only performs direct calls
if (propertyBackedBean instanceof AbstractPropertyBackedBean)
try
{
((AbstractPropertyBackedBean) propertyBackedBean).setSaveSetProperty(true);
if (propertyBackedBean instanceof AbstractPropertyBackedBean)
{
((AbstractPropertyBackedBean) propertyBackedBean).setSaveSetProperty(false);
}
this.initializeFromPersistedProperties(name, propertyBackedBean);
}
finally
{
if (propertyBackedBean instanceof AbstractPropertyBackedBean)
{
((AbstractPropertyBackedBean) propertyBackedBean).setSaveSetProperty(true);
}
}

this.initializeFromPersistedProperties(name, propertyBackedBean);
}

protected void handleRemovedPropertyBackedBean(final PropertyBackedBean propertyBackedBean, final boolean permanent)
Expand Down

0 comments on commit 98964e3

Please sign in to comment.