I guess if the databases are separated, the best bet security and sanity-wise 
is to use separate Cayenne stacks for each DataSource. 

Prior to 3.1 we had explicit multitenancy configured as multiple DataDomains 
per project. In 3.1 we dropped that feature as redundant and hard to manage in 
favor of separately configured CayenneRuntime instances. 

So in a multitenancy environment, you would have a map of CayenneRuntimes, one 
per customer/DataSource and set the current one per-request based on some 
request parameters (user auth, URL, etc.). This allows for full separation, and 
independent tweaking of each runtime configuration. 

Cheers,
Andrus


On Aug 1, 2012, at 3:56 AM, Aristedes Maniatis wrote:
> We do this. Take a look at the qualifiers you can add within the model... a 
> great way to enforce data selection by one customer at a time. But that 
> approach is to have all the data in one database with just a column to 
> discriminate. Not separate databases.
> 
> What you are wanting to do is switch database resources per request. Perhaps 
> your solution lies within your application container (eg. tomcat) rather than 
> in Cayenne. But be very careful about data caching... you are going to have a 
> headache with that.
> 
> Ari
> 
> 
> 
> On 1/08/12 2:05am, vinod kumar wrote:
>> I am looking around for a multi tenancy ORM tool to use in my Java
>> application
>> 
>> I have the following situartion
>> 
>> a primary customer table
>> 
>> 
>> Customer ID  Customer Name  Jndi Datasource
>> 
>> 1                   Mrx                    jndi 1
>> 2                   Mry                    jndi 2
>> 
>> 
>> 
>> at run time based on which customer is logged , i want to call different
>> jndi's. Each jndi posts to different dbs but shares the exact same schema
>> 
>> For purpose of isolation i cannot store all information in one table/db and
>> discriminate each row by Customer ID
>> 
>> 
>> Any help would be great , as based on this i am hoping to use cayenne
>> 
>> Thanks
>> Vinod
>> 
> 
> -- 
> -------------------------->
> Aristedes Maniatis
> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
> 

Reply via email to