Hi yo umention to use DataSourceFactory. I have seen this method
https://github.com/apache/tomee/blob/98029f7374edea604347e1c0a5f598fb793a65e6/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/DataSourceFactory.java#L85
but how I can set Properties like username, password, ...

El dt., 12 maig 2015 a les 11:35, Alex Soto (<[email protected]>) va
escriure:

> Cool thank you so much. I am going to work in this direction :).
>
> El dt., 12 maig 2015 a les 11:33, Romain Manni-Bucau (<
> [email protected]>) va escriure:
>
> Hi Alex
>>
>> a dynamic router is surely the way to go, ie one datasource fully handled
>> by tomee and other ones handled by you. You can of course reuse tomee
>> DataSourceFactory to help to make it smooth and reuse our configuration
>> but
>> you'll have to instantiate them (ie call the create method yourself) and
>> destroy them as well.
>>
>> There are ways to add them in the container with few code but you wouldn't
>> get any benefit from it and you would surely get potentially few drawbacks
>> if you share your container instance with other apps.
>>
>> Hope it helps
>>
>>
>>
>> Romain Manni-Bucau
>> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
>> <http://rmannibucau.wordpress.com> | Github <
>> https://github.com/rmannibucau> |
>> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
>> <http://www.tomitribe.com>
>>
>> 2015-05-12 11:20 GMT+02:00 Alex Soto <[email protected]>:
>>
>> > Hi guys,
>> >
>> > I have one question. Currently I am developing a multitenant application
>> > which each tenant has its own database schema. The schema in fact is a
>> > Oracle DB schema.
>> >
>> > So each tenant may need its own DataSource because each tenant will have
>> > its own login and password.
>> >
>> > The problem is that we need to add dynamically new tenants which implies
>> > defining new datasources on demand. Is this possible in TomEE? I am
>> > thinking in doing using a DynamicRouter to dynamically choose which
>> > DataSource to use depending on the tenant that it is making the
>> request,.
>> >
>> > Thank you so much.
>> > Alex.
>> >
>>
>

Reply via email to