[FIRSTCUP-17] SEQUENCE Table was not deleted automatically while undeploying firstcup-war Created: 22/Aug/13  Updated: 22/Aug/13  Resolved: 22/Aug/13

Status: Resolved
Project: firstcup
Component/s: examples
Affects Version/s: 7.0.1, 7.0.2
Fix Version/s: current

Type: Improvement Priority: Minor
Reporter: TangYong Assignee: Ian Evans
Resolution: Works as designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
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.



 Comments   
Comment by Ian Evans [ 22/Aug/13 ]

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.





Generated at Tue Aug 04 07:49:31 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.