Due to a long-standing bug in the resource copy/new release function some properties where not copied correctly and are not reachable/visible on the copy. This affected properties that were defined on incoming relations (slave relations) of the resource that was copied. More details here: #487. These properties cause errors in an optimized Oracle query that was reactivated in Liima v1.17.27 and need to be recovered and cleaned up before deploying the new version.
The optimized query can also be disabled by setting the environment variable AMW_DISABLE_OPTIMIZED_PROPERTY_DESCRIPTORS_FOR_RESOURCE_QUERY
to "false".
- Run the query below to find the affected properties. It will display the broken/hidden property with value and between which resources it's defined.
-- this query doesn't find the property if the property descriptor was renamed in the copy or the original resource.
select tamw_propertydescriptor.propertyname, tamw_property.value, tamw_context.name context, tamw_propertydescriptor.id as desc_id_prop, tamw_resourcectx_propdesc.propertydescriptors_id as desc_id_res, tamw_consumedresrel.masterresource_id, tamw_consumedresrel.slaveresource_id
from tamw_resrelctx_prop
left join tamw_property on tamw_resrelctx_prop.properties_id = tamw_property.id
left join tamw_propertydescriptor on tamw_propertydescriptor.id = tamw_property.descriptor_id
left join tamw_resrelcontext on tamw_resrelctx_prop.tamw_resrelcontext_id = tamw_resrelcontext.id
left join tamw_context on tamw_resrelcontext.context_id = tamw_context.id
left join tamw_consumedresrel on tamw_resrelcontext.consumedresourcerelation_id = tamw_consumedresrel.id
left join tamw_resource on tamw_consumedresrel.slaveresource_id = tamw_resource.id
left join tamw_resourcecontext on tamw_resource.id = tamw_resourcecontext.resource_id and tamw_resourcecontext.context_id=1
left join tamw_resourcectx_propdesc on tamw_resourcecontext.id = tamw_resourcectx_propdesc.tamw_resourcecontext_id
left join tamw_propertydescriptor rel_desc on tamw_resourcectx_propdesc.propertydescriptors_id = rel_desc.id
where
tamw_propertydescriptor.propertyname = rel_desc.propertyname
and tamw_propertydescriptor.id != tamw_resourcectx_propdesc.propertydescriptors_id
order by tamw_propertydescriptor.propertyname, tamw_context.id desc;
- Properties that you want to recover have to be copied manually into to correct relation property in the Liima UI. Resource ids can be copied from the query result into the url of the editResourceView UI.
- Delete all broken properties. This will delete the properties in the query above with relations and audit entries (which are also broken).
CREATE TYPE prop_ids_type AS TABLE OF NUMBER;
DECLARE
prop_ids sys.odcinumberlist := sys.odcinumberlist();
BEGIN
select tamw_property.id bulk collect into prop_ids
from tamw_resrelctx_prop
left join tamw_property on tamw_resrelctx_prop.properties_id = tamw_property.id
left join tamw_propertydescriptor on tamw_propertydescriptor.id = tamw_property.descriptor_id
left join tamw_resrelcontext on tamw_resrelctx_prop.tamw_resrelcontext_id = tamw_resrelcontext.id
left join tamw_context on tamw_resrelcontext.context_id = tamw_context.id
left join tamw_consumedresrel on tamw_resrelcontext.consumedresourcerelation_id = tamw_consumedresrel.id
left join tamw_resource on tamw_consumedresrel.slaveresource_id = tamw_resource.id
left join tamw_resourcecontext on tamw_resource.id = tamw_resourcecontext.resource_id and tamw_resourcecontext.context_id=1
left join tamw_resourcectx_propdesc on tamw_resourcecontext.id = tamw_resourcectx_propdesc.tamw_resourcecontext_id
left join tamw_propertydescriptor rel_desc on tamw_resourcectx_propdesc.propertydescriptors_id = rel_desc.id
where
tamw_propertydescriptor.propertyname = rel_desc.propertyname
and tamw_propertydescriptor.id != tamw_resourcectx_propdesc.propertydescriptors_id
order by tamw_propertydescriptor.propertyname, tamw_context.id desc;
delete from tamw_resrelctx_prop where properties_id in (select * from table(prop_ids));
delete from tamw_resrelctx_prop_aud where properties_id in (select * from table(prop_ids));
delete from tamw_property where id in (select * from table(prop_ids));
delete from tamw_property_aud where id in (select * from table(prop_ids));
END;
/
After that Liima v1.17.27 can be deployed normally.