Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » CDO - Duplicate of the 'xxx' for the key 1
CDO - Duplicate of the 'xxx' for the key 1 [message #68293] Thu, 18 January 2007 11:04 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
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 #601647 is a reply to message #68452] Wed, 24 January 2007 09:43 Go to previous message
Gregoire DUPE is currently offline Gregoire DUPEFriend
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
>>
Previous Topic:[Teneo] few questions for eval
Next Topic:XMI to Teneo resource copy fails
Goto Forum:
  


Current Time: Wed Apr 24 20:08:48 GMT 2024

Powered by FUDForum. Page generated in 0.03304 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top