代理org.springframework.orm.jpa.SharedEntityManagerCreator:invoke:289 [英] Proxy For org.springframework.orm.jpa.SharedEntityManagerCreator:invoke:289
问题描述
我正在为我目前正在开发的应用程序执行基准测试。经过大量的迭代,我们可以识别出花费时间的组件。
它是一个使用Spring Data JPA和hibernate作为持久性提供程序的基于Web的应用程序。
从监控工具中,我们发现类代理对于org.springframework.orm.jpa.SharedEntityManagerCreator:invoke:289
是运行更多数量(2000个)并发线程所花费的时间。
请让我知道可能的原因和解决方案。
$ b
以下是我使用
的版本Spring - 4.1.7.RELEASE
Hibernate - 4.2.15.Final
Spring Data JPA - 1.8.0 .RELEASE
以下是向下钻取的调用图
EntityManager
该特定线程的实例。根据规范的定义,如果您使用JPA,那么应该发生
您发布的行号意味着它是对 EntityManager
实例的反射方法调用花费了那么多时间。所以我会检查实际被调用的方法,它做了什么以及为什么需要这么长时间。 SharedEntityManagerCreator
基本上只是转发呼叫。
I am performing benchmark testing for the application that i am currently working on. After a lot of iteration, we could identify that the time taking component.
Its a web based application using Spring Data JPA with hibernate as persistence provider.
From the monitoring tool we found that class Proxy For org.springframework.orm.jpa.SharedEntityManagerCreator:invoke:289
is where a lot time spent when running more number(2000) of concurrent threads.
Kindly let me know the possible cause and solution please.
Below are the versions i am working with Spring - 4.1.7.RELEASE Hibernate - 4.2.15.Final Spring Data JPA - 1.8.0.RELEASE Below is the drilled down call graph
SharedEntityManagerCreator
is creating a fresh EntityManager
instance for that particular thread. If you work with JPA, that's what's supposed to happen as an EntityManager
by definition of the spec is not thread-safe.
The line number you posted implies that it's the reflective method call on the EntityManager
instance is taking that much time. So I'd inspect what method actually gets called, what it does and why it takes so long. SharedEntityManagerCreator
is basically just forwarding the call.
这篇关于代理org.springframework.orm.jpa.SharedEntityManagerCreator:invoke:289的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!