Cannot delete organization from Jaspersoft 7.8
search cancel

Cannot delete organization from Jaspersoft 7.8

book

Article ID: 213985

calendar_today

Updated On:

Products

Clarity PPM On Premise Clarity PPM SaaS

Issue/Introduction

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:

  1. Jaspersoft Server running version 7.8 is a pre-requisite, along with Clarity PPM version 15.9.1 or higher
  2. Import organization into the Jaspersoft server using the steps documented:
  3. Now, login to the Jaspersoft server as superuser
  4. Navigate to Manage -> Organizations
  5. Select the Organization that was imported in step 2 and click on "Delete"

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

Environment

Clarity Versions: 15.9.1, 15.9.2

Jaspersoft Version: 7.8

Cause

Due to a defect with ID DE60818.

Resolution

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.