Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Commit delete before insert when having unique key.

PamelaNov 27 2013 — edited Nov 28 2013

Hello,

I have a use case where a database field that is entered by the user should be unique.

In the database there is already a record for example "name1".

The user inserts a new record and puts for its name "name1" as well. Then for some reason decides to delete the first existing record and tries to save the new record "name1".

On commit the old record 'name1' is not deleted yet but the new record with 'name1' is trying to be inserted.

Then I am getting error: Attribute value 'name1' leads to duplicate keys for this entity type. oracle.jbo.AttrValException...

Is there a way to execute delete before insert on commit or another work around?

JDev Version 11.1.2.3.0

Regards

This post has been answered by Karnakar Thallapalli on Nov 27 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 26 2013
Added on Nov 27 2013
10 comments
833 views