[opencms-dev] How to re-initialze the app after DB replication (without app context restart)

Florian Hopf hopf at synyx.de
Mon Oct 24 07:57:00 CEST 2011


Am 24.10.2011 07:31, schrieb Florian Hopf:
> Hi Mathias,
> 
> Am 24.10.2011 04:17, schrieb Mathias Lin:
>>
>> I have two OpenCms servers A and server B and replicating the DB from server
>> A to server B while servers are running. While all DB tables are identical,
>> server B sometimes doesn't show content resources (i.e. structured content
>> files in the workplace, in the frontend) that should be there actually,
>> until I restart the app context.
>> Seems that some caching or locks in the ORM layer are still in place.
>> I was hoping to be able to re-initialize the content delivery mechanism
>> somehow via the cmsshell, but couldn't find any suitable command.
>>
>> Is there any way to 'refresh' and force server B to display the correct
>> resources as they have been replicated to it's database without having to
>> restart the app context?
>>
> 
> You might try the event EVENT_CLEAR_CACHES, something like this:
> 
> OpenCms.fireCmsEvent(I_CmsEventListener.EVENT_CLEAR_CACHES, new HashMap())
> 

To clarify: This very likely won't work when invoked from CmsShell. You
will have to fire the event from within the instance that is serving the
content. A possible solution might be a webservice call that triggers
the event. There are probably more things to take care of like
rebuilding search indexes.

Regards
Florian



More information about the opencms-dev mailing list