Forum Stats

  • 3,838,691 Users
  • 2,262,394 Discussions
  • 7,900,732 Comments

Discussions

Entity Validator executing twice

Varun Dhondea
Varun Dhondea Member Posts: 163 Blue Ribbon
edited Apr 18, 2018 9:13AM in JDeveloper and ADF

Hi,

I have an entity validator but when i am saving the record it is triggering twice.

Issue is i am doing a sql query to validate for duplicates in DB. First time it is ok no records but second time it is getting the record from the EO cache,

pastedImage_0.png

Is there a way to avoid duplicate checking? or avoid calling the method twice?

Any reason why this method executes twice?

Jdeveloper: 12.2.1.1

Tagged:

Answers

  • ManishPandey
    ManishPandey Member Posts: 1,722 Silver Trophy
    edited Apr 18, 2018 8:04AM

    Varun,

    Your question is not clear to me. please explain your use case little bit more.

    If your table have primary key it's automatically deal with duplication rows. And you can also create primary key in entity if does not exist in database or add unique key validation.

  • Varun Dhondea
    Varun Dhondea Member Posts: 163 Blue Ribbon
    edited Apr 18, 2018 8:52AM

    Hi Manish,

    The primary key is based on active dates also i.e there should be no two records which are active for the same dates.

    That is why i need to check in db but validator is triggering twice. 1st time it is correct but 2nd time it is caching in EO and then triggering the error that record already exists

  • ManishPandey
    ManishPandey Member Posts: 1,722 Silver Trophy
    edited Apr 18, 2018 9:13AM
    Varun Dhondea wrote:That is why i need to check in db but validator is triggering twice. 1st time it is correct but 2nd time it is caching in EO and then triggering the error that record already exists

    What do you mean by need to check in db?

    Have you added any validation in Entity?

This discussion has been closed.