Raymond,

I found a possible solution here:
http://blog.springsource.com/2007/01/23/dynamic-datasource-routing

TenantId is hold in the Struts UserSession and shall be shared with
spring layer. The described solution uses ThreadLocal for this purpose.

Is it possible to provide this tenantId to the spring layer using
ThreadLocal ?

Is the UserSession bound to the ThreadLocal ?

Questions, questions :)

Regards and a lot of thanks to all
Eduard

Am 16.10.2010 16:50, schrieb Raymond He:
> To Li Ying and Dave New ton, multiple datasources is a common
> requirement in large scale e-commerce  and telecom application.
>                                     I used a data object to table
> mapping to do DB routing vertically, pk hashing to route horizontally.
>                                The routing operation should not be
> done by Struts, but by persistent layer.
>
> 2010/10/15, Eduard Neuwirt <eduard.neuw...@googlemail.com>:
>> Hello,
>>
>> I am looking for an elegant solution for the following situation.
>>
>> I have a multitenant struts/spring/hibernate application. Every tenant is
>> stored in own database within the same RDBMS. All databases has the same
>> schema. At the spring layer every tenant is represented as a datasource.
>> Because I use the Hibernate I have to create multiple SessionFactories to
>>
>> How can I provide the correct Seesionfactory to the UserSession in struts.
>> Once I have is the tenantId stored in UserSession itself.
>>
>> Please help
>> Eduard
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to