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!

Primary key issue with adf Entry Form.

ManishPandeyOct 3 2013 — edited Oct 4 2013

Hi All,

i'm using jdev version 11.1.1.5.0

use case: i have create simple entry form based on Eo and Vo using database table like student(enrollment no,name address)

where enrollment no is primary key.

so when i have create a record i have set enrollment no in entity impl class of this eo create method using some logic based on my need like(20130001)

for that i have read highest no from database field and assign to enrollment no field when user create record.

so when user create record second time then enrollment no is 20130002. and other detail like name and address user fill and commit record. and it is fine.

but problem is that when two user access same form at a time and create record so both have get same primary key like 20130003 because in current time in database maximum value is 20130002.

so which userĀ  commit record first it record will save on database and second user get error message because of primary key violation.

so my question is that where we generate primary key value for record so when multiple user access form have get different primary key value. and in my use case i can't use sequence and any autoincrement no

because i have patter for primary key.

Thanks in Advance

Manish

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 1 2013
Added on Oct 3 2013
6 comments
842 views