This content has been marked as final. Show 5 replies
First of all check your sequence in SQL developer and confirm if the NEXTVAL increases sequence by 1 or 2. After you are confirmed that it increased by 1 only, then there must be a case that your sequence is being invoked twice.
So you can have your create method invocation in the AM called only on specific conditions so that its not called by itself. Also ensure if the Id is set already, it should not be overwritten by updated value. Hope this gives you clues. Not sharing code snippet since it kills the joy of learning. :)
Thanks for your responses.
it is not an issue with sequence, issue where and how to use the sequence. While opening the page or form which initializes VO in PR method. In EOimpl i have used the sequence in create method. So it is initialized as 1 and the cache is stored 1 as current value. If any error in page submission also the sequence cache remains in its current value. Next time i submit the form without error so now the sequence stores the value as 2. This is the issue , because first time i didnt submit the form just i open and close. Second time i have submitted without error. so my table skips value 1 and starts with 2.
If i initialize the sequence during commit method, this skip wont occur. But i need to initialize in PR itself.
Has anybody met this issue?
Thanks & Regards,