Uploaded image for project: 'EJBCA'
  1. EJBCA
  2. ECA-7662

SecurityEvents*SessionBeanTest fails on H2 dues to use of ORDER in DELETE

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: EJBCA 5.0.0
    • Fix Version/s: EJBCA 7.0.0, EJBCA 6.15.2
    • Component/s: None
    • Labels:

      Description

      org.cesecore.audit.SecurityEventsAuditorSessionBeanTest fails when running on the H2 database during SecurityEventsAuditorSessionBeanTest.setUpCryptoProvider() where it tries to invoke org.cesecore.audit.impl.integrityprotected.IntegrityProtectedAuditorSessionBean.deleteRows(AuthenticationToken, Date, Properties) for initial clean up.

      This fails with an Exception that isn't present on the test client JVM which obscures the error:

      javax.ejb.EJBTransactionRolledbackException: org.hibernate.hql.internal.ast.QuerySyntaxException: expecting EOF, found 'ORDER' near line 1, column 107 [DELETE FROM org.cesecore.audit.impl.integrityprotected.AuditRecordData a WHERE a.timeStamp <= :timeStamp0 ORDER BY a.sequenceNumber ASC]
      

      And the root problem is that we do ORDER BY on a SQL DELETE query which makes no sense even if other databases kindly ignores or handles it.

      This failure also leads to a failure for org.cesecore.audit.log.SecurityEventsLoggerSessionBeanTest.test05ExportGeneratedLogs(), since it will use the same call for deleting the logs after export.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              johan Johan Eklund
              Reporter:
              johan Johan Eklund
              Verified by:
              Samuel Lidén Borell
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 5 minutes
                  5m