firstcup
  1. firstcup
  2. FIRSTCUP-17

SEQUENCE Table was not deleted automatically while undeploying firstcup-war

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Works as designed
    • Affects Version/s: 7.0.1, 7.0.2
    • Fix Version/s: current
    • Component/s: examples
    • Labels:
      None
    • Environment:

      GlassFish 4

      Description

      1 asadmin deploy firstcup-war.war

      2 asadmin undeploy firstcup-war

      3 asadmin deploy firstcup-war.war

      PER01003: Deployment encountered SQL Exceptions:
      PER01000: Got SQLException executing statement "CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL(15), PRIMARY KEY (SEQ_NAME))": java.sql.SQLException: Table/View 'SEQUENCE' は、既に Schema 'APP' に存在します。
      Command deploy completed with warnings.

      The exception is not friendly and we should also delete SEQUENCE Table while undeploying firstcup-war.

        Activity

        Hide
        Ian Evans added a comment -

        This is actually the correct behavior, as SEQUENCE is a table that is used by the persistence provider for auto-generated primary keys. firstcup-war uses SEQUENCE, but other applications might also use SEQUENCE for their auto-generated primary keys.

        The persistence provider (in this case EclipseLink) will create SEQUENCE if it doesn't exist when you first deploy firstcup-war, but will not delete it when firstcup-war is undeployed because other applications may have been subsequently deployed that depend on SEQUENCE for auto-generated primary keys.

        The SQLException thrown on deployment isn't fatal, and subsequent deployments of firstcup-war will use auto-generated primary keys further down the sequence.

        Show
        Ian Evans added a comment - This is actually the correct behavior, as SEQUENCE is a table that is used by the persistence provider for auto-generated primary keys. firstcup-war uses SEQUENCE, but other applications might also use SEQUENCE for their auto-generated primary keys. The persistence provider (in this case EclipseLink) will create SEQUENCE if it doesn't exist when you first deploy firstcup-war, but will not delete it when firstcup-war is undeployed because other applications may have been subsequently deployed that depend on SEQUENCE for auto-generated primary keys. The SQLException thrown on deployment isn't fatal, and subsequent deployments of firstcup-war will use auto-generated primary keys further down the sequence.

          People

          • Assignee:
            Ian Evans
            Reporter:
            TangYong
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: