Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] [Help] JPA-2.1 EclipseLink try to create constraints multiple times and throw warning

Hello experts,
 
We noticed duplicated constraint creation warning in application logs when the application was first accessed since started. Since the constraint already exists, why eclipselink tries to create again and throw warnings? thanks.
 
[9/26/17 10:12:32:926 EDT] 0000007a eclipselink                                                  W CWWJP9991W: Exception [EclipseLink-4002] (Eclipse Pers    istence Services - 2.6.3.WAS-v20160817-8475a53): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.ibm.db2.jcc.am.SqlSyntaxErrorException: The name of the object to be created is identical to the existing name "WRKLDLDMDULEWRKLD    D" of type "FOREIGN KEY".. SQLCODE=-601, SQLSTATE=42710, DRIVER=3.63.123
Error Code: -601
Call: ALTER TABLE WORKLOAD_LOADMODULE ADD CONSTRAINT WRKLDLDMDULEWrkldD FOREIGN KEY (Workload_ID) REFERENCES WORKLOAD (ID)
Query: DataModifyQuery(sql="ALTER TABLE WORKLOAD_LOADMODULE ADD CONSTRAINT WRKLDLDMDULEWrkldD FOREIGN KEY (Workload_ID) REFERENCES WORKLOAD (ID)")
 
While another Unique constraint in the following, eclipselink ignore the duplicated creation, which makes more sense. Was the above error related to join table?
 
[9/26/17 10:12:32:883 EDT] 0000007a query         3   Execute query DataModifyQuery(sql="ALTER TABLE USERPREFERENCES ADD CONSTRAINT USERPREFERENCES0 UNIQUE (username)")
[9/26/17 10:12:32:884 EDT] 0000007a connection    3   Connection acquired from connection pool [read].
[9/26/17 10:12:32:884 EDT] 0000007a connection    3   reconnecting to external connection pool
[9/26/17 10:12:32:884 EDT] 0000007a sql           3   ALTER TABLE USERPREFERENCES ADD CONSTRAINT USERPREFERENCES0 UNIQUE (username)
[9/26/17 10:12:32:900 EDT] 0000007a sql           3   The referential, primary key, or unique constraint "USERPREFERENCES0" is ignored because it is a duplicate constraint.. SQLCODE=541, SQLSTATE=01543, DRIVER=3.63.123:01543 - null
[9/26/17 10:12:32:901 EDT] 0000007a connection    3   Connection released to connection pool [read].
 
Thanks & Best Regards

Austin ( 周运杰/Yun Jie Zhou)
z/OS System Test and Performance, China System & Technology Lab
Tel: 86-10-82452455 Ext: 52455
Mobile: 13811310391
E-Mail: yunjiez@xxxxxxxxxx
 
 
----- Original message -----
From: Yun Jie Zhou/China/IBM
To: eclipselink-users@xxxxxxxxxxx
Cc: eclipselink-dev@xxxxxxxxxxx
Subject: [Help] JPA-2.1 EclipseLink try to create constraints multiple times and throw warning
Date: Wed, Sep 27, 2017 10:56 AM
 
 
Hello experts,
 
We noticed duplicated constraint creation warning in application logs. Since the constraint already exists, why eclipselink tries to create again and throw warnings? thanks.
 
[9/26/17 10:12:32:926 EDT] 0000007a eclipselink                                                  W CWWJP9991W: Exception [EclipseLink-4002] (Eclipse Pers    istence Services - 2.6.3.WAS-v20160817-8475a53): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.ibm.db2.jcc.am.SqlSyntaxErrorException: The name of the object to be created is identical to the existing name "WRKLDLDMDULEWRKLD    D" of type "FOREIGN KEY".. SQLCODE=-601, SQLSTATE=42710, DRIVER=3.63.123
Error Code: -601
Call: ALTER TABLE WORKLOAD_LOADMODULE ADD CONSTRAINT WRKLDLDMDULEWrkldD FOREIGN KEY (Workload_ID) REFERENCES WORKLOAD (ID)
Query: DataModifyQuery(sql="ALTER TABLE WORKLOAD_LOADMODULE ADD CONSTRAINT WRKLDLDMDULEWrkldD FOREIGN KEY (Workload_ID) REFERENCES WORKLOAD (ID)")
 
While another Unique constraint in the following, eclipselink ignore the duplicated creation, which makes more sense. Was the above error related to join table?
[9/26/17 10:12:32:883 EDT] 0000007a query         3   Execute query DataModifyQuery(sql="ALTER TABLE USERPREFERENCES ADD CONSTRAINT USERPREFERENCES0 UNIQUE (username)")
[9/26/17 10:12:32:884 EDT] 0000007a connection    3   Connection acquired from connection pool [read].
[9/26/17 10:12:32:884 EDT] 0000007a connection    3   reconnecting to external connection pool
[9/26/17 10:12:32:884 EDT] 0000007a sql           3   ALTER TABLE USERPREFERENCES ADD CONSTRAINT USERPREFERENCES0 UNIQUE (username)
[9/26/17 10:12:32:900 EDT] 0000007a sql           3   The referential, primary key, or unique constraint "USERPREFERENCES0" is ignored because it is a duplicate constraint.. SQLCODE=541, SQLSTATE=01543, DRIVER=3.63.123:01543 - null
[9/26/17 10:12:32:901 EDT] 0000007a connection    3   Connection released to connection pool [read].
 
Thanks & Best Regards

Austin ( 周运杰/Yun Jie Zhou)
z/OS System Test and Performance, China System & Technology Lab
Tel: 86-10-82452455 Ext: 52455
Mobile: 13811310391
E-Mail: yunjiez@xxxxxxxxxx
 


Back to the top