performance issue on Spring Data Mongodb

最后都变了- 提交于 2019-12-04 08:05:54

I'm not sure if this applies to your exact case but I had a very similar situation with a lot of time being wasted in ClassUtils.forName() and ClassLoader.load().

I've inspected the situation under the debugger and the root cause in my case was that the class I was trying to deserialize the document to had been moved to a different package. In this case, Spring Data can't properly cache type information and issues a slow and expensive ClassLoader.load() on the persisted _class field for each document!

Of course, this class load is doomed to fail because it references a class that no longer exists at the location stored int the _class field of the document.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!