Context We have a database containing some configuration information. People can change the configuration data, but it isn't applied to underlying systems until some later moment in time.
This is why we would like to have 2 states of our entities: - pending (entities in this state still have to be processed) - applied (entities in this state are processed / changes are applied to underlying systems)
We consider solving this by having two datasources: - one containing the entities in "pending" state - a second containing the entities in "applied" state
This is why we are looking into hibernate replication, so after configuration is applied we can replicate changes from the "pending" datasource to the "applied" datasource.
At first glance the tool seems to do this job very wel.
Problem During replicaiton to a second datasource orphanRemoval isn't working. It does set the related id to NULL, but it doesn't remove the related (orphan) record. However on save orphanRemoval IS working, so I guess my configurtion is ok.
I have created a JUNIT TEST triggering this problem. See: https://github.com/rdomingonl/hibernate-orphan-problem
Is there any way to fix/workaround this ? (Or isn't this supposed to work ?)
|