Skip to content

Upgrade to release 3.7.0

Step 1: Prerequisites

  1. Inform users about the upgrade: stop creating new deliveries, transactional support on CRUD models will be disallowed.
  2. Stop the i-refactory server.

Step 2: Upgrading i-refactory metadata model

Follow the generic instructions for upgrading the metadata repository as described in Upgrading the i-refactory repository model in SQLServer.

This upgrade script will:

Create the following database columns:

  • acm_uam_datadel.s_delivery_properties.csv_loader_specification

Modify the following columns:

  • acm_uam_datalog.s_entity_update_status.message_text to nvarchar(max)
  • acm_uam_datalog.s_interface_update_status.message_text to nvarchar(max)
  • acm_uam_datalog.s_task_run_status.message_text to nvarchar(max)

Create the following index(es):

  • CREATE NONCLUSTERED INDEX [ix01] ON [acm_uam_datalog].[s_task_run_properties] ([l_delivery_id])

The upgrade is executed within a transaction. An error will result in a rollback. Contact i-Refact support in case of unexpected failures.

Step 3: Upgrade the i-refactory server to release 3.7.0

  1. Copy the complete folder i-refactory-engine to the appropriate location.
  2. Start the server, the upgrade will be executed automatically.

Changes applied during startup

During the startup of the i-refactory server the following changes will be applied automatically:

  1. The application version is updated to release 3.7.0
  2. For each temporal context table in the fact store (a table with transaction datetime in it's primary key) an additional unique nonclustered index will be created with a generated name irefactory_generated_ak_idx if such an index does not exist.
  3. The i-refactory generic data access interface objects are regenerated (views, procedures, triggers, ...).

Create the index irefactory_generated_ak_idx prior before upgrading

Creating the additional indexes upon restart of the i-refactory engine may take quite some time.
You could opt for creating these addtional indexes prior before restarting the i-refactory server.

The following SQL script generates a create index statement.
You can apply filters for which model or namespace you want to generate these index statements.

Copy/paste the content of the column create_index_statement to a new window and simply run the statements or wrap them in a stored procedure.

with context_entities as
(
    select e.id
         , i.code as interface_code
         , i.database_code
         , e.namespace_code 
         , e.code
         , e.key_id_primary
    from   acm_datadef_oasi_bk.entity e
    join   acm_datadef_oasi_bk.interface i
    on     i.id = e.interface_id
    join   acm_datadef.[unique_key] k
    on     k.id = e.key_id_primary
    where  e.architecture_layer_code='CFPL'
    and    e.classification_code not in ('STABLE INDEPENDENT', 'STABLE DEPENDENT')
    and    exists
        (
            select 1
            from   acm_datadef.unique_key k
            join   acm_datadef.key_attribute ka
            on     ka.key_id = k.id
            join   acm_datadef_oasi_bk.attribute a
            on     a.id = ka.attribute_id
            and    a.classification_code='TRANSACTION TIMELINE START'
            where  k.id = e.key_id_primary
        )
)
, index_columns as 
(
    select e.id
         , string_agg( '[' + a.code + ']', ',') WITHIN GROUP (ORDER BY coalesce(ka.ordinal_nbr,999)) as index_columns
    from   context_entities e
    join   acm_datadef_oasi_bk.attribute a
    on     a.entity_id=e.id
    left
    join   acm_datadef.key_attribute ka
    on     ka.attribute_id= a.id
    and    ka.key_id =  e.key_id_primary
    where  a.classification_code != 'TRANSACTION TIMELINE START'
    and    (ka.id is not null or a.classification_code='TRANSACTION TIMELINE END')
    group  by e.id
)
select e.interface_code
     , e.database_code
     , e.namespace_code
     , e.code as entity_code
     , 'IF NOT EXISTS 
(
    SELECT * 
    FROM   [' + e.database_code + '].[sys].[indexes] 
    WHERE name = ''irefactory_generated_ak_idx'' AND object_id = OBJECT_ID(''[' + e.database_code + '].[' + e.namespace_code + '].[' +  e.code + ']'')
) AND EXISTS
(
    SELECT 1 WHERE OBJECT_ID(''[' + e.database_code + '].[' + e.namespace_code + '].[' +  e.code + ']'') IS NOT NULL
) 
BEGIN 
    create unique nonclustered index irefactory_generated_ak_idx on [' + e.database_code + '].[' + e.namespace_code + '].[' + e.code + '](' + ic.index_columns +'); 
END;
' as create_index_statement
from   context_entities e 
join   index_columns ic 
on     ic.id = e.id
where  e.interface_code = 'TPC_H_CFPL'
;

This is an example for a single entity for which an additional index should be created if it does not yet exist:

IF NOT EXISTS 
(
    SELECT * 
    FROM   [IR_CFPL].[sys].[indexes] 
    WHERE name = 'irefactory_generated_ak_idx' AND object_id = OBJECT_ID('[IR_CFPL].[tpc_h].[h_brand_properties]')
) 
AND EXISTS 
(
    SELECT OBJECT_ID('[IR_CFPL].[tpc_h].[h_brand_properties]')
) 
BEGIN 
    create unique nonclustered index irefactory_generated_ak_idx on [IR_CFPL].[tpc_h].[h_brand_properties]([id],[acm_end_dt]); 
END;