[hibernate-commits] [hibernate/hibernate-orm] 51c673: HHH-12791 Cache the Component type to avoid genera...

GitHub noreply at github.com
Thu Jul 19 04:01:45 EDT 2018


  Branch: refs/heads/master
  Home:   https://github.com/hibernate/hibernate-orm
  Commit: 51c67310f7c3b491a6135af4790e702688dcde3b
      https://github.com/hibernate/hibernate-orm/commit/51c67310f7c3b491a6135af4790e702688dcde3b
  Author: Guillaume Smet <guillaume.smet at gmail.com>
  Date:   2018-07-19 (Thu, 19 Jul 2018)

  Changed paths:
    M hibernate-core/src/main/java/org/hibernate/mapping/Component.java
    M hibernate-core/src/test/java/org/hibernate/test/component/proxy/ComponentBasicProxyTest.java

  Log Message:
  -----------
  HHH-12791 Cache the Component type to avoid generating one proxy per call

While Javassist only generates one proxy as the name is stable,
ByteBuddy uses random names and thus generates a new proxy for every
call, leading to the generation of 18 different proxies for the other
test of the test class.

We can't do better than using a volatile/synchronized pattern as the
Component is not fully initialized in the constructor.

Maybe we could take the risk of admitting that the getType() method is
called at least once before we pass the element to a multi-threaded
environment but that's a bet I don't want to take alone.



      **NOTE:** This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the hibernate-commits mailing list