PostgreSQL duplicate primary key error

2006-08-02 Thread François Reboursier

Hi list,

	I'm running accross a strange problem: when inserting multiple  
objects of the same class to the DB, I get the following exception:
SQL State:23505 -- error code: 0 -- msg: ERROR: duplicate key  
violates unique constraint moduleinmodule_pk

When inserting one object at time, it works great.

Example in less-than-pseudo-code:

Create instance of object
Insert object to editing context
Modify object
Create other instance of the same class
Insert to EC
Modify object
EC.saveChanges()
 = crash

Create instance of object
Insert object to editing context
Modify object
EC.saveChanges()
= it works

The EOModel is properly configured, the primary key is not editable
It happens only with objects of this class ('moduleinmodule')

Configuration: WO 5.3.1, PostgreSQL 8.0.1

Do you have any pointers?

Regards,
François ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com


Re: PostgreSQL duplicate primary key error

2006-08-02 Thread Miguel Arroz

Hi!

  Are you doing anything with relationships? That happened to me  
when I modeled some relationships in the wrong way.


  Also, have you installed both PSQL plugins (the framework, and the  
one for Modeler) and generated the SQL in the Modeler correctly?


  Yours

Miguel Arroz

On 2006/08/02, at 11:09, François Reboursier wrote:


Hi list,

	I'm running accross a strange problem: when inserting multiple  
objects of the same class to the DB, I get the following exception:
SQL State:23505 -- error code: 0 -- msg: ERROR: duplicate key  
violates unique constraint moduleinmodule_pk

When inserting one object at time, it works great.

Example in less-than-pseudo-code:

Create instance of object
Insert object to editing context
Modify object
Create other instance of the same class
Insert to EC
Modify object
EC.saveChanges()
 = crash

Create instance of object
Insert object to editing context
Modify object
EC.saveChanges()
= it works

The EOModel is properly configured, the primary key is not editable
It happens only with objects of this class ('moduleinmodule')

Configuration: WO 5.3.1, PostgreSQL 8.0.1

Do you have any pointers?

Regards,
François ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/arroz% 
40guiamac.com


This email sent to [EMAIL PROTECTED]



  GUERRA E' PAZ
   LIBERDADE E' ESCRAVIDAO
   IGNORANCIA E' FORCA   -- 1984

Miguel Arroz
http://www.ipragma.com



___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com