How to Turn Off Journalling Programmatically
I need to turn off Journalling for a particular database programmatically.
How can I make it happen?
Product version: IRIS 2020.4
I need to turn off Journalling for a particular database programmatically.
How can I make it happen?
I have used the following inside one of the classes before executing a huge ingest process.
Then turned journalling back on again after the ingestion was complete.
Thanks, Kinshuk!
This is helpful but this is a SYSTEM wide call. Do you know a way how to turn off journalling for a particular database?
Evgeny,
Fortunately, I had a simple setup and so the consequence of disabling jounalling across the system was imperceptible to me. Hoping someone else has a better answer.
Hello Evgeny,
The ^%SYS.NOJRN tags are actually not system-wide, and just at the process level. That being said, for changing the actual database journaling status, perhaps Lucas' solution makes sense.
For more info on disabling journaling, I think Tani's article series is great. Here's his chapter on some methods to disable journaling. Perhaps you'll find something useful to you now or later:
https://community.intersystems.com/post/preventing-globals-getting-journaled-continued-how-do-i-minimize-my-journals
consider also that even when you use the DISABLE^%SYS.NOJRN if you are within a transaction globals will be saved (e.g when doing a %Save() on an object).
To prevent this you may use:
$system.OBJ.SetTrandsactionMode(0) - to disable transaction
$system.OBJ.SetTrandsactionMode(1) - to enable transaction (leter)
In Caché I use this:
Thanks, Lucas!
This is what I'm looking for!
Where can I find the Config.Database class?
It's in the %SYS namespace
Process-wide call:
do DISABLE^%NOJRN
Hi!
In older versions of Caché, this command works:
Do DISABLE^%NOJRN
Do ENABLE^%NOJRN
I hope it can help you.
Hug
Rica
Thanks @Ricardo Baehr