We ran the timer which is for migrating the data (bulk insert) from one module to another with different database catalogue for SQL Server , but the job failed with , Invalid object name 'OSSYS_CYCLIC_JOB_SHARED . All the logics were executed successfully and the timer failed internally .
This is happening across all environments.
We got support from official OutSystems and they pointed that , this is the issue with the plugin.
"The error observed, Invalid object name 'OSSYS_CYCLIC_JOB_SHARED, occurred because the extension 'BulkInsert' does not go back to the main catalog after the insert is executed in the different catalog. This means that the platform is not able to return to the 'main' catalog and tries to access a system table in the other catalog, where the table doesn't exist.To surpass this issue, you need to ensure that the extension contains code to change back to the 'main' catalog once it finishes executing the database operations in the other catalog ".
Please look at this issue.
I know it doesn't address the full issue but you could try calling the bulk insert plugin again pointing to the main catalog and inserting some dummy data somewhere. That hopefully will reset your catalog. Messy but might help until the plugin is looked at.
Using Commit Transaction once after the bulk inserts will resolve this issue
Ouytsystems supported advised us to add an advanced sql query with the statement USE [<name_of_default_catalog>] (in our case USE [PlatformDB]).
That workaround (as the fix is not in the same place as the problem) seems to work, although it is rather unfortunate that we have been unable to find the physical catalog name anywhere in the system tables and thus hardcoded it.
The most obvious fix in the BulkInsert extension itself would be to use ForDatabase instead of ForRunningApplication when a catalog is specified. However, as exactly that is in comments in BulkInsert.cs, that must have been tried already. What was the reason to abandon that direction and why was ik kept as a comment without any explanation?Another attempt might be to close the connection (either at the outsystems level or the driver connection). The documentation (https://success.outsystems.com/documentation/11/reference/outsystems_apis/runtimepublic_db_api/#connection:~:text=void-,Close(),-Closes%20the%20connection) unfortunately does not explain when a conection can, should and should not be closed.