Jack Li · Jan 26, 2021

How to implement transaction processing

How to implement transaction processing when using healthConnect to link external data for data operation

0 199
Discussion (7)1
Log in or sign up to continue

Hello Jack,

I have done this previously in this class:

Class User.OperationSQL Extends Ens.BusinessOperation


Parameter ADAPTER = "EnsLib.SQL.OutboundAdapter";

Property Adapter As EnsLib.SQL.OutboundAdapter;


I have this code to begin transaction:

set tSC = ..Adapter.SetAutoCommit(0)

I have this code to commit transaction:

set tSC = ..Adapter.Commit()

In case of rollback I use this code:

Set rollbackSt = ..Adapter.Rollback()

@Oliver Wilms: What version ($ZV) are you referencing that SQL operation / adapter please?  Thanks in advance.

I believe we were working on HealthShare 2017. Not sure why you ask?

... because we're running 2018 and that SQL operation does not exist to use in our operations:

Cache for UNIX (Red Hat Enterprise Linux for x86-64) 2018.1.4 (Build 505_1U) Thu May 28 2020 10:11:16 EDT [HealthShare Modules:Core:15.032.9035 + Linkage Engine:15.032.9035]

I created a new class (User.OperationSQL) which extends Ens.BusinessOperation and uses 


Parameter ADAPTER = "EnsLib.SQL.OutboundAdapter";

Property Adapter As EnsLib.SQL.OutboundAdapter;


Do you see Ens.BusinessOperation and EnsLib.SQL.OutboundAdapter?

lol, reading is fundamental.  Thank you for pointing out what should have been obvious.

I missed the "User" in your example as a custom implementation.  I just reviewed these provided adapters, very nice!  What continues to puzzle me is why the product does not provide a Business Operation off them (and others).  I know, support issues, right?

I just completed a custom "adaptation" using their provided Util.Pipe adapter, because the code was a bit crusty.  It did serve as nice reference source, just not as nice as these SQL adapters.