Discussion:
Adding a new datasource during runtime?
Karl Kildén
2017-11-27 15:27:03 UTC
Permalink
Hello!

For production we use tomee.xml and for development resources.xml and are
very happy.


Our next app to convert to tomee is multi-tenant with a hard requirement on
logical separation so we will need a Router and dynamic datasources. This
is also working very well in my tests.

We will have hundreds of datasources and a restart to add a new one is not
efficient enough.

- Can we centralize the resource definitions?
- Can we reload the definitions if we add a new one during runtime?


Cheers
Romain Manni-Bucau
2017-11-27 15:42:42 UTC
Permalink
Hi

if you have a router impl you can just use your own datasource manager
behind it and manage it the way you want no?

Romain Manni-Bucau
@rmannibucau | Blog | Old Blog | Github | LinkedIn
Post by Karl Kildén
Hello!
For production we use tomee.xml and for development resources.xml and are
very happy.
Our next app to convert to tomee is multi-tenant with a hard requirement on
logical separation so we will need a Router and dynamic datasources. This
is also working very well in my tests.
We will have hundreds of datasources and a restart to add a new one is not
efficient enough.
- Can we centralize the resource definitions?
- Can we reload the definitions if we add a new one during runtime?
Cheers
Karl Kildén
2017-11-27 15:50:33 UTC
Permalink
Hi,

Thanks for the idea. And to have it jta managed etc? Anything I need to think about to make it behave as normal. No source in front of me now but maybe enough to use correct datasource impl?

Skickat från min iPhone
Post by Romain Manni-Bucau
Hi
if you have a router impl you can just use your own datasource manager
behind it and manage it the way you want no?
Romain Manni-Bucau
@rmannibucau | Blog | Old Blog | Github | LinkedIn
Post by Karl Kildén
Hello!
For production we use tomee.xml and for development resources.xml and are
very happy.
Our next app to convert to tomee is multi-tenant with a hard requirement on
logical separation so we will need a Router and dynamic datasources. This
is also working very well in my tests.
We will have hundreds of datasources and a restart to add a new one is not
efficient enough.
- Can we centralize the resource definitions?
- Can we reload the definitions if we add a new one during runtime?
Cheers
Paul Carter-Brown
2017-11-27 15:54:35 UTC
Permalink
Hi Karl,

Do you know at build/deploy time what drivers you will be using (e.g.
MySQL, Postgres etc). If so it would probably be easiest to point a set of
datasources to HAProxy on say port 10000, 10001 etc and then do the runtime
setup on HAProxy by configuring the frontend to backend mappings as you
wish. This also gives you the ability to do automatic failover etc
Post by Karl Kildén
Hi,
Thanks for the idea. And to have it jta managed etc? Anything I need to
think about to make it behave as normal. No source in front of me now but
maybe enough to use correct datasource impl?
Skickat från min iPhone
Post by Romain Manni-Bucau
Hi
if you have a router impl you can just use your own datasource manager
behind it and manage it the way you want no?
Romain Manni-Bucau
@rmannibucau | Blog | Old Blog | Github | LinkedIn
Post by Karl Kildén
Hello!
For production we use tomee.xml and for development resources.xml and
are
Post by Romain Manni-Bucau
Post by Karl Kildén
very happy.
Our next app to convert to tomee is multi-tenant with a hard
requirement on
Post by Romain Manni-Bucau
Post by Karl Kildén
logical separation so we will need a Router and dynamic datasources.
This
Post by Romain Manni-Bucau
Post by Karl Kildén
is also working very well in my tests.
We will have hundreds of datasources and a restart to add a new one is
not
Post by Romain Manni-Bucau
Post by Karl Kildén
efficient enough.
- Can we centralize the resource definitions?
- Can we reload the definitions if we add a new one during runtime?
Cheers
--
*Paul Carter-Brown*

*Group Chief Information Officer*

*Smile Communications Pty (Ltd) *
Smile +234 (0) 702 000 1234
Mobile +27 (0) 83 4427 179
Skype PaulC-B
paul.carter-***@smilecoms.com
www.smilecoms.com
--
This email is subject to the disclaimer of Smile Communications at http://www.smilecoms.com/home/email-disclaimer/ <http://www.smilecoms.com/disclaimer>
Romain Manni-Bucau
2017-11-27 15:56:29 UTC
Permalink
being managed is not that hard, you can check
https://github.com/apache/tomee/blob/master/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/managed/JTADataSourceWrapperFactory.java
out

Romain Manni-Bucau
@rmannibucau | Blog | Old Blog | Github | LinkedIn
Post by Paul Carter-Brown
Hi Karl,
Do you know at build/deploy time what drivers you will be using (e.g.
MySQL, Postgres etc). If so it would probably be easiest to point a set of
datasources to HAProxy on say port 10000, 10001 etc and then do the runtime
setup on HAProxy by configuring the frontend to backend mappings as you
wish. This also gives you the ability to do automatic failover etc
Post by Karl Kildén
Hi,
Thanks for the idea. And to have it jta managed etc? Anything I need to
think about to make it behave as normal. No source in front of me now but
maybe enough to use correct datasource impl?
Skickat från min iPhone
Post by Romain Manni-Bucau
Hi
if you have a router impl you can just use your own datasource manager
behind it and manage it the way you want no?
Romain Manni-Bucau
@rmannibucau | Blog | Old Blog | Github | LinkedIn
Post by Karl Kildén
Hello!
For production we use tomee.xml and for development resources.xml and
are
Post by Romain Manni-Bucau
Post by Karl Kildén
very happy.
Our next app to convert to tomee is multi-tenant with a hard
requirement on
Post by Romain Manni-Bucau
Post by Karl Kildén
logical separation so we will need a Router and dynamic datasources.
This
Post by Romain Manni-Bucau
Post by Karl Kildén
is also working very well in my tests.
We will have hundreds of datasources and a restart to add a new one is
not
Post by Romain Manni-Bucau
Post by Karl Kildén
efficient enough.
- Can we centralize the resource definitions?
- Can we reload the definitions if we add a new one during runtime?
Cheers
--
*Paul Carter-Brown*
*Group Chief Information Officer*
*Smile Communications Pty (Ltd) *
Smile +234 (0) 702 000 1234
Mobile +27 (0) 83 4427 179
Skype PaulC-B
www.smilecoms.com
--
This email is subject to the disclaimer of Smile Communications at http://www.smilecoms.com/home/email-disclaimer/ <http://www.smilecoms.com/disclaimer>
Loading...