You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by "Wright, Jim (NIH/CIT) [C]" <wr...@mail.nih.gov> on 2006/07/25 20:31:43 UTC

Unique keys and OJB having trouble

I'm trying to update a row in a table which has a primary key, 4 unique
keys (unique constraint) and a few more data fields. I have naturally
one primary key specified for the table in my repository_user.xml file.
When I store the row, I get a Unique restraint violation for the unique
constraint on the 4 uks. The primary key value is generated using a
sequence. Is there any way to configure the table so that it will update
the row? Are there any settings you need to do this operation?

Jim Wright [Contractor - SRA International]

Web Developer

Web Development Team

Custom Applications Branch (CAB)

Division of Enterprise and Custom Applications, CIT/NIH/DHHS

6707 Democracy Blvd, Suite 304

Bethesda, MD 20892

Office: 301.

Email: wrightjr@mail.nih.gov

URL: http://webdev.cit.nih.gov/ <http://www.cit.nih.gov/deca> 

 


Re: Unique keys and OJB having trouble

Posted by Armin Waibel <ar...@apache.org>.
Hi Jim,

Wright, Jim (NIH/CIT) [C] wrote:
> I'm trying to update a row in a table which has a primary key, 4 unique
> keys (unique constraint) and a few more data fields. I have naturally
> one primary key specified for the table in my repository_user.xml file.
> When I store the row, I get a Unique restraint violation for the unique
> constraint on the 4 uks. The primary key value is generated using a
> sequence. Is there any way to configure the table so that it will update
> the row? Are there any settings you need to do this operation?
> 

Could you please post the mapping for this class and the stack trace. 
Does OJB perform an update or does it try to insert the object again 
(e.g. with different PK)?

regards,
Armin


> Jim Wright [Contractor - SRA International]
> 
> Web Developer
> 
> Web Development Team
> 
> Custom Applications Branch (CAB)
> 
> Division of Enterprise and Custom Applications, CIT/NIH/DHHS
> 
> 6707 Democracy Blvd, Suite 304
> 
> Bethesda, MD 20892
> 
> Office: 301.
> 
> Email: wrightjr@mail.nih.gov
> 
> URL: http://webdev.cit.nih.gov/ <http://www.cit.nih.gov/deca> 
> 
>  
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org