Quantcast

cache settings per environment

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

cache settings per environment

martin.gutenbrunner
Hi all,

I am working on a project where I access several identical database-
schemas on individual database instances.
It is an onlineshop where a single webserver hosts several shops,
every shop having it's individual database instance.

It is a requirement that every database instance can be accessed by
using different caching strategies.

I think that being able to configure caching for each environment
would solve my problem.

Is configuration by environment already available? I did not find any
information about it in the docs.
Or is it something that can be accomplished by writing a cache plugin?

Or would this require deeper changes in mybatis?

Thanks for your help, any answer is highly appreciated!

Cheers,
Martin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: cache settings per environment

Eduardo Macarron
MyBatis replaces config properties in all its files so I suppose you
can build one SqlSessionFactory for each database with different
properties:

SqlSessionFactory build(InputStream inputStream, Properties properties)

And use that properties in cache definitions inside xml mappers.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: cache settings per environment

Martin Gutenbrunner
Wow, works great.

Did not think I would be that easy

Thanks!

2012/2/20 Eduardo Macarron <[hidden email]>
MyBatis replaces config properties in all its files so I suppose you
can build one SqlSessionFactory for each database with different
properties:

SqlSessionFactory build(InputStream inputStream, Properties properties)

And use that properties in cache definitions inside xml mappers.

Loading...