Written by

Enterprise Application Development Consultant at The Ohio State University Wexner Medical Center
MOD
Question Scott Roth · 1 hr ago

Difference between Extending EnsLib.SQL.Snapshot vs creating a Property for EnsLib.SQL.Snapshot

We are working on Disk Consolidation and looking at Class/Globals that are rather large and not being cleaned up by the nightly Purge process. We have implemented DeleteHelper - A Class to Help with Deleting Referenced Persistent Classes | IDC on any Custom Data Classes, and Business Processes (BPL).

We have a bunch of Data Classes, BPL's, and Operations that connect to external MS SQL Server using JDBC to query or write data to using Stored Procedures and Queries. All that Query external tables are using EnsLib.SQL.Snapshot, and this is being written to ^Ens.AppData which is not cleaned up.

Looking at EnsLib.SQL.Snapshot not cleaned during purge messages when used in Response Message | IDC, it says to reference EnsLib.SQL.Snapshot within the Class as a Property. 

What is the difference between referencing EnsLib.SQL.Snapshot as a Property vs just Extending EnsLib.SQL.Snapshot to the Custom Data Class? If you extend EnsLib.SQL.Snapshot does this help with the issue of not writing the data directly to Ens.AppData?

To Rewrite all of our BPL's to use EnsLib.SQL.Snapshot as a Property of a difference Data Class would take some time to do vs just Extending EnsLib.SQL.Snapshot to a new data class.

Product version: IRIS 2025.1
$ZV: IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2025.1.3 (Build 481_1U) Tue Feb 3 2026 15:24:

Comments

DC AI Bot · 1 hr ago Bot

When you use EnsLib.SQL.Snapshot in your production, there are significant differences between extending EnsLib.SQL.Snapshot directly and using it as a property within another class. Here are the distinctions:

EnsLib.SQL.Snapshot as a Property:

  • If EnsLib.SQL.Snapshot is referenced directly in the response message (for example, a property of a response class), its data is stored in the global ^Ens.AppData and will not be cleaned up by the standard purging process for messages. This can lead to growth in the global’s data over time, which creates storage concerns in production systems 1.
  • Avoiding direct use of EnsLib.SQL.Snapshot as a property in return messages is recommended. Instead, map snapshot data to other types (like a custom class or JSON strings) 1.
  • Alternatively, you can implement the %OnDelete method within the class to handle purging of snapshot data yourself by explicitly deleting the referenced snapshot data 1.

Extending EnsLib.SQL.Snapshot:

  • Extending EnsLib.SQL.Snapshot means creating a new class derived from it. This approach may seem convenient, but it does not inherently solve the problem of snapshot data accumulating in ^Ens.AppData. The purge service won’t automatically remove this snapshot data if it is passed as part of the response message 1.
  • EnsLib.SQL.Snapshot is designed to persist result set data and is primarily used with SQL adapters for production.

Recommendation for Your Use Case:

  • Considering your situation with a substantial rewrite involved, the fastest resolution may involve implementing specialized cleanup methods, such as %OnDelete, within the relevant classes. This would not eliminate the need for rework but provide control over snapshot lifecycle management without completely redesigning your processes 1.


Sources:

Tell us more:
Don't like the style
Not factually correct
Didn't fully follow instructions
Refused when it shouldn't have
Being lazy
More...
Submit
0 0