Javers comparison takes long time

312 Views Asked by At

We are comparing 2 objects using javers in our project. But in a delete secanrio it is taking lot of time which leads to application time out.

Is it possible to bypass the inner objects from comparison in javers.

1

There are 1 best solutions below

0
On

You are not providing much information, but depending on the relations between your entities, javers might be comparing your whole database, or at least much more than you expect.

This happens, because javers will walk all relations of the object to be compared recursively. This can lead to a lot of select-statements going to the database to fetch extra objects.

You can stop it from doing that, by putting @JaversIgnore or @ShallowReference on the relations that you do not want it to compare.