Hi All,
First I want give a Shout Out to @Theo Stolker and @Rupert Young. Because they helped me with the solution.
When you're using the EnsLib.SQL.Snapshot as a Property in the Response Message to return Snapshot data (,e.g.: from Business Operation to Business Process,) the Snapshot data won't be cleaned with the Purge messages task/service.
{
Property SnapshotProp As EnsLib.SQL.Snapshot;
}
The data will be stuck in the global: ^Ens.AppData. You can find it with this query in System>Globals: ^Ens.AppData("EnsLib.SQL.Snapshot",
.png)
The reference is recored in the class: EnsLib.SQL.Snapshot you can query it with SQL: SELECT * FROM EnsLib_SQL.Snapshot ORDER BY ID asc
.png)
These data won't be deleted during the Purging task. So the Data will be growing over time. When you have this issue, you can clean all the data manually with the following method:
- Clean Global: ^Ens.AppData:
- Stop Production
- Run on terminal(, be sure you're on the right NameSpace): do ##class(Ens.Adapter).ClearStaticAppData("EnsLib.SQL.Snapshot")
- Start Production
- Clean EnsLib_SQL.Snapshot :
- Delete with SQL: TRUNCATE TABLE EnsLib_SQL.Snapshot
But this is not ideal, especially on the PRD environment.
Solution:
This issue only happens when you're returning data from BO to BP, or maybe from BP to BS. Because the idea is the same.
One solution is not to use EnsLib_SQL.Snapshot as a property in the return message. But to map the data to another objectType (e.g.: JSON as String, other classTypes).
Another solution is to make the Purging task purge the Snapshot data with
https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=GO...
So:
{
Property SnapshotProp As EnsLib.SQL.Snapshot;
ClassMethod %OnDelete(oid As %ObjectIdentity) As %Status [ Private, ServerOnly = 1 ]
{
set id = $$$oidPrimary(oid)
set obj = ..%OpenId(id)
return ##class(EnsLib.SQL.Snapshot).%DeleteId(obj.SnapshotProp.%Id())
}
}
Hope it wil help you as it's helped me!
PS: Related post: https://community.intersystems.com/post/setting-enslibsqlsnapshot-vs-ens...

