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!

Concurrent access issue

Ambily-OracleMar 26 2014 — edited Mar 26 2014

We have a use case in our application where we need to create an entity. Each entity will have a start date and end date. These are sequential in order based on start and end dates.

We are facing an issue in this use case. Since we have business rules that we should not have duplicates we have created a unique constraint on the start date in entity level. Everything works perfect from UI. The issue started when automated tests are run. We have multiple test all running the above use case and normally the tests are fired together which might run in parallel. We recently noticed that there are duplicate rows getting created in the system. We assume the only reason this happens can be the tests running in parallel which might be firing the inserts before or after simultaneous. Since the unique constraint on the entity level also not stopping the duplicate, we are not sure how to handle this issue.

                                                                                                                                                                                                                                                      

If anyone is familiar with these kind of use case, any suggestions would be really helpful. Can any kind of synchronization be done to handle this.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 23 2014
Added on Mar 26 2014
1 comment
302 views