Spring 4 Ehcache 3 Hibernate 5 cache default template setup -


my project on spring 4.3.4, hibernate 5.2.4 , ehcache 3.3

i looking solution singular jsr-107 (jcache) cachemanager whole application provide:

  • spring caching - number of explicitly named caches;
  • hibernate l2 caching - ability implicitly generate number of regions (which in fact caches too)

the main concern here hibernate. in fact, question of setting default template regions. after review of lot of topics have not discovered suitable solution.

so, if exists, i'm kindly ask experts point it. programmatic way of configuring highly appreciated (ehcache.xml unwanted).

added: (in answer @anthony dahanne): have seen solution in project pointing before posted topic. more, project starting point of investigation week ago.

but solution involving explicit declaration of several named cache regions not spring, hibernate, can find in cacheconfiguration#createcacheconfigurations method.

this inconvinient in real project wich contains 100500 different entities, naturalkeys , on, managed hibernate, because them should create appropriate regions on fly. distinct main power of hibernate's regionfactory ability magic work automaticly. see in pointed project in customized jcacheregionfactory class? direct ban generate new regions, implemented means of unconditional exception thrown on attempt (it noted "...but makes sure caches existing prevent spontaneous creation of badly configured caches..." comment).

the ideal solution must able set sole "default template" (on cachemanager level) works in case of encache.xml (...jcache:defaults default-template="mydefaulttemplate...), ...but without xml.

there jhipster fullstack demo example on ehcache3-samples github repo

this example based on spring boot programmatically sets ehcache3 cache, exposing a jsr-107 cachemanager

this cache used in conjunction hibernate , also independently.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -