intersystems / ipm

InterSystems ObjectScript Package Manager
MIT License
27 stars 19 forks source link

Open Transaction and Production starting issues #439

Open evshvarov opened 7 months ago

evshvarov commented 7 months ago

This application starts production after installastion.

zpm "install iris-hl7"

And it reports errors because of open transaction:

USER>zpm "install iris-hl7"

[USER|iris-hl7] Reload START (/usr/irissys/mgr/.modules/USER/iris-hl7/0.1.0/)
[USER|iris-hl7] requirements.txt START
[USER|iris-hl7] requirements.txt SUCCESS
[USER|iris-hl7] Reload SUCCESS
[iris-hl7]  Module object refreshed.
[USER|iris-hl7] Validate START
[USER|iris-hl7] Validate SUCCESS
[USER|iris-hl7] Compile START
[USER|iris-hl7] Compile SUCCESS
[USER|iris-hl7] Activate START
[USER|iris-hl7] Configure START
09:27:18.030:Ens.Director: Production 'otw.NewProduction' starting...
09:27:18.093:Ens.Queue: 1 open user transaction found; committing before EnQueue(1)
09:27:18.093:Ens.Director: Production 'otw.NewProduction' started.
[USER|iris-hl7] Configure SUCCESS
[USER|iris-hl7] Activate SUCCESS
ERROR! ObjectScript error: <COMMAND>LoadNewModule+133^%ZPM.PackageManager.Developer.Utils.1 *NoTransaction
isc-tleavitt commented 6 months ago

This has been encountered internally as well. It would be great for IPM to provide a way to do this in a background job to isolate from the current transaction. (I've held the position of "Library code, including Ens.Director, shouldn't commit/roll back callers' transactions as a side effect" to no avail.)

isc-tleavitt commented 6 months ago

Calling this a enhancement - specifically, we need to provide a "right way" to have an <Invoke> do something outside of the transaction and only after installation has fully completed.