2

Consider, i have a global ^TEST and i want to replicate/have a copy of the same in ^TEST2 automatically.Each action set or kill on ^TEST should reflect on ^TEST2 automatically.

  • What is your goal in this? If your purposes are for backup/high availability, you should be looking into Shadowing or Mirroring. – Brandon Horst May 07 '14 at 13:04

1 Answers1

2

The only way to make sure that this can happen 100% reliably is to create a Journal Filter which watches for changes to ^TEST and then manipulates ^TEST2 appropriately.

See http://docs.intersystems.com/cache20141/csp/docbook/DocBook.UI.Page.cls?KEY=GCDI_journal#GCDI_journal_util_ZJRNFILT for details on how to implement this.

Ben
  • 101
  • 1
  • While this is a correct answer, usually it doesn't make much sense to implement this unless OP is doing some theoretical exercise or university assignment. For practical purposes there have to be better way to handle this, but we need more information about OP's problem to give a correct advice. – SSH May 08 '14 at 04:26
  • Your link to `ZJRNFILT` says that this filter is only called during a journal restore operation. In other words, it is a manual operation to invoke it. I think you'd have to constantly poll the journal to look for new SET/KILL records for ^TEST and apply them to ^TEST2. – Gabe Mar 22 '15 at 06:36
  • I am fairly sure that it is called during any dejournaling operation, so this includes application the shadowing logic. When I needed to do this (several years ago) I configured the Caché instance to be its own shadow, but in ZJRNFILT I didn't actually restore the records, but used them to trigger the creation of other records (e.g. an audit record). This way it was constantly polling via the shadowing mechanism. – Ben Mar 23 '15 at 11:51