CDO - Duplicate of the 'xxx' for the key 1 [message #68293] |
Thu, 18 January 2007 11:04 |
Eclipse User |
|
|
|
Originally posted by: gregoire.dupe.francetelecom.com
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
|
|
|
Re: CDO - Duplicate of the 'xxx' for the key 1 [message #68452 is a reply to message #68293] |
Sat, 20 January 2007 19:12 |
Eclipse User |
|
|
|
Originally posted by: stepper.sympedia.de
Gregoire,
I have some problems to understand what the code should do. Do you
create 3 objects, add them to a resource and let the first object
cross-reference the remaining two objects?
Can you please open a Bugzilla?
BTW. what happens if you omit the superfluous first commit()?
Cheers
/Eike
Gregoire DUPE schrieb:
> 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
>
|
|
|
Re: CDO - Duplicate of the 'xxx' for the key 1 [message #69123 is a reply to message #68452] |
Wed, 24 January 2007 09:43 |
Eclipse User |
|
|
|
Originally posted by: gregoire.dupe.francetelecom.com
Hi,
You have correctly understood the problem. I can precise that I just
used a reference and not a cross-reference.
If I remove the first commit, the program runs correctly.
I opened the bug report in Bugzilla.
Thanks,
Gregoire
Eike Stepper wrote:
> Gregoire,
>
> I have some problems to understand what the code should do. Do you
> create 3 objects, add them to a resource and let the first object
> cross-reference the remaining two objects?
> Can you please open a Bugzilla?
>
> BTW. what happens if you omit the superfluous first commit()?
>
> Cheers
> /Eike
>
>
> Gregoire DUPE schrieb:
>> 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
>>
|
|
|
Re: CDO - Duplicate of the 'xxx' for the key 1 [message #601440 is a reply to message #68293] |
Sat, 20 January 2007 19:12 |
|
Gregoire,
I have some problems to understand what the code should do. Do you
create 3 objects, add them to a resource and let the first object
cross-reference the remaining two objects?
Can you please open a Bugzilla?
BTW. what happens if you omit the superfluous first commit()?
Cheers
/Eike
Gregoire DUPE schrieb:
> 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
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: CDO - Duplicate of the 'xxx' for the key 1 [message #601647 is a reply to message #68452] |
Wed, 24 January 2007 09:43 |
Gregoire DUPE Messages: 2 Registered: July 2009 |
Junior Member |
|
|
Hi,
You have correctly understood the problem. I can precise that I just
used a reference and not a cross-reference.
If I remove the first commit, the program runs correctly.
I opened the bug report in Bugzilla.
Thanks,
Gregoire
Eike Stepper wrote:
> Gregoire,
>
> I have some problems to understand what the code should do. Do you
> create 3 objects, add them to a resource and let the first object
> cross-reference the remaining two objects?
> Can you please open a Bugzilla?
>
> BTW. what happens if you omit the superfluous first commit()?
>
> Cheers
> /Eike
>
>
> Gregoire DUPE schrieb:
>> 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.03304 seconds