Home » Eclipse Projects » EclipseLink » Caching a Multi-tenant applicantion
Caching a Multi-tenant applicantion [message #499349] |
Fri, 20 November 2009 20:02  |
Eclipse User |
|
|
|
Hi,
First, let me thank you for your effort making this product available as
community open-source.
Consider a multi-tenant application, that uses a shared database with
differents schemas (one for each tenant) , with a three tier web
application.
Can you share your thoughts of how caching could be enabled in this kind
of application and what are the consequences.
Thank you in advance, and please be tolerant with my english and little
knowledge of EclipseLink
Geraldo Lopes de Souza
|
|
| |
Re: Caching a Multi-tenant applicantion [message #499362 is a reply to message #499353] |
Sat, 21 November 2009 07:25   |
Eclipse User |
|
|
|
tbee,
By "disable caching" have you meant shared cache ?.
According to the docs there are 3 types of caches: Session cache, Unit
of Work Cache and Isolated Client session. Which one do you use ?
Thank you in advance,
Geraldo Lopes de Souza
References
http://wiki.eclipse.org/Introduction_to_Cache_%28ELUG%29
http://wiki.eclipse.org/Introduction_to_EclipseLink_Sessions _%28ELUG%29#Isolated_Client_Sessions
Em 21-11-2009 05:31, tbee escreveu:
> As soon as you have multiple clients accessing the database (in my case
> stand alone swing apps) you need to disable caching in order to be able
> to get changes made in the DB into your memory.
>
>
> Geraldo Lopes de Souza wrote:
>> Hi,
>>
>> First, let me thank you for your effort making this product available
>> as community open-source.
>>
>> Consider a multi-tenant application, that uses a shared database with
>> differents schemas (one for each tenant) , with a three tier web
>> application.
>>
>> Can you share your thoughts of how caching could be enabled in this
>> kind of application and what are the consequences.
>>
>> Thank you in advance, and please be tolerant with my english and
>> little knowledge of EclipseLink
>>
>> Geraldo Lopes de Souza
>>
>>
>>
>>
|
|
|
Re: Caching a Multi-tenant applicantion [message #499698 is a reply to message #499349] |
Mon, 23 November 2009 13:36   |
Eclipse User |
|
|
|
How are you enabling each tenant to use their own schema?
If you have a persistence-unit or EntityManagerFactory per tenant, then you should be fine with the shared cache on, which is the default.
If you have a single persistence-unit, or single EntityManagerFactory, and are configuring the different schemas per EntityManager, then you need to disable the shared cache, as each EntityManager sees different data.
The shared cache is the session cache.
It can be disabled using the persistence-unit property,
"eclipselink.cache.shared.default"="false"
You can also selectively disable/enable it for certain classes, if you have some data in a shared schema.
The UnitOfWork and IsolatedClientSession cache can be for the most part ignored, the only live as long as the EntityManager or transaction.
|
|
|
Re: Caching a Multi-tenant applicantion [message #499794 is a reply to message #499362] |
Tue, 24 November 2009 03:11   |
Eclipse User |
|
|
|
Half my family has the mexican flue, so I needed to divert some of my time the last few day :-)
Anyhow, I'm using JPA and I configured this in order to get the changes in the DB made by other EM's, after I do a clear() on mine;
lOptions.put(PersistenceUnitProperties.CACHE_SHARED_DEFAULT, "false");
FYI: CACHE_TYPE_DEFAULT = "eclipselink.cache.type.default"
Geraldo Lopes de Souza wrote:
> tbee,
>
> By "disable caching" have you meant shared cache ?.
> According to the docs there are 3 types of caches: Session cache, Unit
> of Work Cache and Isolated Client session. Which one do you use ?
>
>
> Thank you in advance,
>
> Geraldo Lopes de Souza
>
> References
> http://wiki.eclipse.org/Introduction_to_Cache_%28ELUG%29
> http://wiki.eclipse.org/Introduction_to_EclipseLink_Sessions _%28ELUG%29#Isolated_Client_Sessions
>
>
>
> Em 21-11-2009 05:31, tbee escreveu:
>> As soon as you have multiple clients accessing the database (in my case
>> stand alone swing apps) you need to disable caching in order to be able
>> to get changes made in the DB into your memory.
>>
>>
>> Geraldo Lopes de Souza wrote:
>>> Hi,
>>>
>>> First, let me thank you for your effort making this product available
>>> as community open-source.
>>>
>>> Consider a multi-tenant application, that uses a shared database with
>>> differents schemas (one for each tenant) , with a three tier web
>>> application.
>>>
>>> Can you share your thoughts of how caching could be enabled in this
>>> kind of application and what are the consequences.
>>>
>>> Thank you in advance, and please be tolerant with my english and
>>> little knowledge of EclipseLink
>>>
>>> Geraldo Lopes de Souza
>>>
>>>
>>>
>>>
>
|
|
|
Re: Caching a Multi-tenant applicantion [message #499930 is a reply to message #499794] |
Tue, 24 November 2009 09:41  |
Eclipse User |
|
|
|
tbee,
Thanks for the answers and good luck for you and your family.
Regards,
Geraldo
Em 24-11-2009 06:11, tbee escreveu:
> Half my family has the mexican flue, so I needed to divert some of my
> time the last few day :-)
>
> Anyhow, I'm using JPA and I configured this in order to get the changes
> in the DB made by other EM's, after I do a clear() on mine;
>
> lOptions.put(PersistenceUnitProperties.CACHE_SHARED_DEFAULT, "false");
>
> FYI: CACHE_TYPE_DEFAULT = "eclipselink.cache.type.default"
>
>
> Geraldo Lopes de Souza wrote:
>> tbee,
>>
>> By "disable caching" have you meant shared cache ?.
>> According to the docs there are 3 types of caches: Session cache, Unit
>> of Work Cache and Isolated Client session. Which one do you use ?
>>
>>
>> Thank you in advance,
>>
>> Geraldo Lopes de Souza
>>
>> References
>> http://wiki.eclipse.org/Introduction_to_Cache_%28ELUG%29
>> http://wiki.eclipse.org/Introduction_to_EclipseLink_Sessions _%28ELUG%29#Isolated_Client_Sessions
>>
>>
>>
>> Em 21-11-2009 05:31, tbee escreveu:
>>> As soon as you have multiple clients accessing the database (in my case
>>> stand alone swing apps) you need to disable caching in order to be able
>>> to get changes made in the DB into your memory.
>>>
>>>
>>> Geraldo Lopes de Souza wrote:
>>>> Hi,
>>>>
>>>> First, let me thank you for your effort making this product available
>>>> as community open-source.
>>>>
>>>> Consider a multi-tenant application, that uses a shared database with
>>>> differents schemas (one for each tenant) , with a three tier web
>>>> application.
>>>>
>>>> Can you share your thoughts of how caching could be enabled in this
>>>> kind of application and what are the consequences.
>>>>
>>>> Thank you in advance, and please be tolerant with my english and
>>>> little knowledge of EclipseLink
>>>>
>>>> Geraldo Lopes de Souza
>>>>
>>>>
>>>>
>>>>
>>
|
|
|
Goto Forum:
Current Time: Wed Jul 23 19:45:20 EDT 2025
Powered by FUDForum. Page generated in 0.27436 seconds
|