Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Caching a Multi-tenant applicantion
Caching a Multi-tenant applicantion [message #499349] Sat, 21 November 2009 01:02 Go to next message
Geraldo Lopes de Souza is currently offline Geraldo Lopes de SouzaFriend
Messages: 6
Registered: November 2009
Junior Member
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 #499353 is a reply to message #499349] Sat, 21 November 2009 07:31 Go to previous messageGo to next message
Tom Eugelink is currently offline Tom EugelinkFriend
Messages: 817
Registered: July 2009
Senior Member
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 #499362 is a reply to message #499353] Sat, 21 November 2009 12:25 Go to previous messageGo to next message
Geraldo Lopes de Souza is currently offline Geraldo Lopes de SouzaFriend
Messages: 6
Registered: November 2009
Junior Member
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 18:36 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

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.


James : Wiki : Book : Blog : Twitter
Re: Caching a Multi-tenant applicantion [message #499794 is a reply to message #499362] Tue, 24 November 2009 08:11 Go to previous messageGo to next message
Tom Eugelink is currently offline Tom EugelinkFriend
Messages: 817
Registered: July 2009
Senior Member
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 14:41 Go to previous message
Geraldo Lopes de Souza is currently offline Geraldo Lopes de SouzaFriend
Messages: 6
Registered: November 2009
Junior Member
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
>>>>
>>>>
>>>>
>>>>
>>
Previous Topic:Unsatisfied import package javax.lang.model.type
Next Topic:Eclipselink is spending an hour releasing write locks
Goto Forum:
  


Current Time: Fri Apr 19 13:10:03 GMT 2024

Powered by FUDForum. Page generated in 0.01611 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top