CDO - Duplicate of the 'xxx' for the key 1 [message #601345] |
Thu, 18 January 2007 06:04 |
Eclipse User |
|
|
|
Hi,
When I run the following program, I get a "DataIntegrityViolation"
exception in the server side.
public X a2x(A self) {
X result = MMBFactory.eINSTANCE.createX();
destModel.getContents().add(result);
EList uList = new BasicEList();
for (int i = 0; i < 2; i++) {
U anonym1 = MMBFactory.eINSTANCE.createU();
destModel.getContents().add(anonym1);
anonym1.setUattr("X" + i);
uList.add(anonym1);
resourceManager.commit();
}
result.getUref().addAll(uList);
resourceManager.commit();
return result;
}
Here you can find the exception stack trace:
Exception in thread "pool-1-thread-4"
org.springframework.dao.DataIntegrityViolationException:
PreparedStatementCallback; SQL [INSERT IGNORE INTO CDO_OBJECT VALUES (?, 1,
?)]; Duplicata du champ '844424930132030' pour la clef 1; nested
exception is java.sql.SQLException: Duplicata du champ '844424930132030'
pour la clef 1
java.sql.SQLException: Duplicata du champ '844424930132030' pour la clef 1
(We can translate "Duplicata du champ '844424930132030' pour la clef 1"
by "Duplicate of the '844424930132030' for the key 1".)
This exception append when we commit after the
"result.getUref().addAll(uList);" instruction.
The output meta-model contains 2 classes X and U. X is composed of U.
Can anybody explain, what's wrong in this use of CDO?
Thanks,
Gregoire
|
|
|
Powered by
FUDForum. Page generated in 0.03901 seconds