can -> yes (just return a datasource proxy which does the same on all datasources for each invocation) should -> no (databases have hard times implementing it so just use it, it will be better regarding all aspects - excepted $$ maybe) Romain Manni-Bucau Twitter: @rmannibucau Blog: http://rmannibucau.wordpress.com/ LinkedIn: http://fr.linkedin.com/in/rmannibucau Github: https://github.com/rmannibucau
2013/11/4 Howard W. Smith, Jr. <smithh032...@gmail.com>: > hmmm okay. can/should tomee/openejb 'dynamic datasources' be used to > replicate data across all databases via some custom JPA persist method that > I would code in routed datasource? > > i'm asking this question after yesterday's review of the (tomee and > openejb) dynamic datasources documentation and code samples. > > > > On Mon, Nov 4, 2013 at 10:21 AM, Romain Manni-Bucau > <rmannibu...@gmail.com>wrote: > >> this doesn't replicate by default bu tif your databases are replicated >> it would work >> Romain Manni-Bucau >> Twitter: @rmannibucau >> Blog: http://rmannibucau.wordpress.com/ >> LinkedIn: http://fr.linkedin.com/in/rmannibucau >> Github: https://github.com/rmannibucau >> >> >> >> 2013/11/4 Howard W. Smith, Jr. <smithh032...@gmail.com>: >> > response inline below, >> > >> > On Sun, Nov 3, 2013 at 10:51 AM, Jean-Louis MONTEIRO <jeano...@gmail.com >> >wrote: >> > >> >> Well, we pushed that feature some years ago already. >> >> We mainly used it to implement a failover mechanism, or to implement >> kinda >> >> cloud features, I mean having each customer data in different databases. >> >> Also the read mostly pattern AFAIR. >> >> >> > >> > okay, I can see how tomee failover supports this (customer data in >> > different databases), ATM, unless I'm missing something. >> > >> > >> >> >> >> Restrictions are mainly transactions not shared and not wrapping >> >> connections from more than one datasource. >> >> >> > >> > I think I confirmed this, too. >> > >> > >> >> The cache configuration must be well configured to not cache stale data. >> >> But it clearly depends on the use case. >> >> >> >> >> > i just did some light testing, created a new row in users table in db1, >> and >> > the new row was 'not' added to the same table in db2. I tried both >> configs >> > below, and they both had the same test results. >> > >> > --- test 1 --- >> > >> > <Resource id="jdbc/mcmsJta" type="DataSource" >> provider="RoutedDataSource"> >> > router = failover-router >> > </Resource> >> > >> > >> > --- test 2 --- >> > >> > <Resource id="jdbc/mcmsJta" type="DataSource" >> provider="RoutedDataSource"> >> > router = failover-router >> > strategy = round-robin >> > </Resource> >> > >> > romain, earlier, you mentioned that maybe this tomee/openejb failover via >> > dynamic datasources may be more/less what i'm looking for. I assumed that >> > this would be a viable replication solution. did I assume incorrectly? >>