It is possible to delete organizations in version 7.1.3 of Jaspersoft Server. It is however not possible to do the same in version 7.8.
Following are high level steps to reproduce the issue:
Expected Results: The selected Organization is deleted
Actual Results: The selected Organization is not deleted. An error is thrown in the UI. Following error is logged in jasperserver.log:
2021-04-29T14:22:44,281 ERROR SecureExceptionHandlerImpl,http-nio-8080-exec-7:116 [|superuser] - failed to lazily initialize a collection, could not initialize proxy - no Session; nested exception is org.hibernate.LazyInitializationException: failed to lazily initialize a collection, could not initialize proxy - no Session
Clarity Versions: 15.9.1, 15.9.2
Jaspersoft Version: 7.8
Due to a defect with ID DE60818.
Since the issue is part of the original product provided by Tibco, this issue has been brought to Tibco's notice. For Clarity, the following workaround can be used.
Workaround:
1. For each tenant ID needing to removed, run the following DELETE query before deleting an organization from the UI in Jaspersoft Server.
The query has to be run against the Jaspersoft DB
Replace in the query <provide_tenant_id> with the actual Organization ID (Tenant ID)
Example: The organization ID = 'alphareno_022222' and would be used in the following delete statement.
DELETE FROM jiobjectpermission WHERE
(
recipientobjectid IN (
SELECT
id
FROM
jirole
WHERE
tenantid IN (
SELECT
id
FROM
jitenant
WHERE
tenantid = '<provide_tenant_id>'
)
)
AND
recipientobjectclass = 'com.jaspersoft.jasperserver.api.metadata.user.domain.impl.hibernate.RepoRole'
) OR (
recipientobjectid IN (
SELECT
id
FROM
jiuser
WHERE
tenantid IN (
SELECT
id
FROM
jitenant
WHERE
tenantid = '<provide_tenant_id>'
)
)
AND
recipientobjectclass = 'com.jaspersoft.jasperserver.api.metadata.user.domain.impl.hibernate.RepoUser'
) OR
uri LIKE '%<provide_tenant_id>%';
2. Delete the Organization via the UI.