Within the AfterProcessChange method of my business processor, I need to execute a simple SELECT statement.
Basically, in a three-level table hierarchy (parent → child → grandchild), when I’m processing a change to a grandchild record, I need to determine the affected parent record ID.
When I try this, it blocks, which I’m presuming is due to the fact that I’m still within the original transaction for the processing of the delta.
Is there any way you can think of that I can execute such a SQL SELECT but within the context of the same transaction?
I’m currently constructing a TDALocalCommand object and calling the Execute method. I presume what I need is some way to get this object to exist/execute within the same transaction as the business process from which I’m calling it?
I can suggest to don’t use TDALocalCommand in this scenario because it uses default transaction logic, i.e. TDALocalCommand.Execute causes start/rollback/commit transaction.
Sorry but I’m struggling to wrap my head around this.
Can you give a basic explanation of how I can use the Connection.NewCommand?
I already have the relevant command configured in my Schema, I just want to execute it, passing a single parameter and retrieving a single result but within the context of the currently running transaction so it doesn’t block.