[hibernate-dev] Provide a RegionFactory from Spring

Steve Ebersole steve at hibernate.org
Mon Jun 18 16:52:33 EDT 2018

Or Class (not String) loaded from the proper ClassLoader

On Mon, Jun 18, 2018 at 3:51 PM Steve Ebersole <steve at hibernate.org> wrote:

> You can pass a RegionFactory instance.
> On Mon, Jun 18, 2018 at 1:48 PM Henri Tremblay <henri.tremblay at gmail.com>
> wrote:
>> Hi,
>> A change in the latest Spring Boot version is now setting a real class
>> loader when creating a JCache cache manager. Before it used to pass null.
>> Just like Hibernate still does.
>> So right now, we end up with two class managers. One for Hibernate 2nd
>> level cache and one for Spring cache.
>> We made a workaround in JHipster. You can see the full code and discussion
>> here
>> https://github.com/hibernate/hibernate-orm/pull/2351
>> It's not super pretty. The Hibernate region factory is instantiated from a
>> property using the no-args constructor. So we set the wanted class loader
>> to a static variable and retrieves it in the region factory
>> implementation.
>> It works. But it's not pretty.
>> I was looking for a cleaner solution. Probably passing a Contributor to
>> Hibernate.
>> Is there a way to programmatically pass a contributor or a region factory
>> to Hibernate? From Spring Boot.
>> Thanks,
>> Henri
>> _______________________________________________
>> hibernate-dev mailing list
>> hibernate-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/hibernate-dev

More information about the hibernate-dev mailing list