%NOCHECK for Objects
When batch inserting data into a table via SQL, I can use the %NOCHECK keyword to avoid checking foreign key integrity. This would be appropriate for cases when the inserted data has been verified by some external process.
However, when inserting via objects, I don't see a way to get the same behavior. Are there any workarounds that use objects for this?
For this case, I have a tool (Tier 2 CCR) for loading many objects into a namespace. The referential integrity of these objects has already be confirmed in a source namespace. Enforcing a specific load order may resolve the issue here, but generally this might not be the case.
Comments
Maybe you can try suppressing foreign key checking while uploading. I think this works when using objects to save
https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cl…
Thanks Ali,
I don't think I can do that for just the current process, so it'd be a pretty big risk to turn off even temporarily.
Are you allowed to edit the class definition? If so, then I think you can temporarily add the NoCheck keyword to the foreign key definition
https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cl…
This has been our workaround - its sufficient for the immediate case, but its not something that we could recommend generally.