简体   繁体   English

Javers比较需要很长时间

[英]Javers comparison takes long time

We are comparing 2 objects using javers in our project.我们在项目中使用 javers 比较了 2 个对象。 But in a delete secanrio it is taking lot of time which leads to application time out.但是在删除 secanrio 中需要花费大量时间,这会导致应用程序超时。

Is it possible to bypass the inner objects from comparison in javers.是否可以绕过javers中的比较内部对象。

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.您没有提供太多信息,但根据实体之间的关系,javers 可能正在比较您的整个数据库,或者至少比您预期的要多得多。

This happens, because javers will walk all relations of the object to be compared recursively.发生这种情况是因为 javers 将递归地遍历要比较的对象的所有关系。 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.您可以通过将@JaversIgnore 或@ShallowReference 放在您不希望它比较的关系上来阻止它这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM