Thanks for the PR's and context provided. I provided feedback on the PR #488 <https://github.com/apache/tomee/pull/488> and I'm also proposing an alternative to declare the Derby XA data source as part of the comments.
What I currently understand: - examples/xa-datasource is currently serving a couple of purposes: - 1) Example of how to inject entity manager, configure the EntityManager via a persistence.xm and Injection via @PersistenceContext - 2) org.superbiz.injection.jpa.MoviesTest.java is a Junit class that shows how to declare a Datasource programmatically and using the embeddable.EJBContainer for lookup. - 3) org.superbiz.injection.jpa.MoviesXATest.java is a Junit test using org.apache.openejb.junit.ApplicationComposer (not arquillian) to define a XA data source programmatically and make some operations by the help of org.superbiz.injection.jpa.MoviesXA (the runner) how is ultimately the one implementing the logic of the XA workflow. - The above test scenarios are triggered when one execute mvn clean test. - In parallel the module is configured to also: - 4) Donwload via maven the jars need it to have a local instance of the Grinder http://grinder.sourceforge.net/ - 5) Have a http rest endpoint configured by org.superbiz.rest.MovieService.java that is deployed when running mvn tomee:run - 6) The module contains grinder wrapper script that set grinder configurations and point to the tests class: org.superbiz.perf.DBTestPerf.java. this class - 7) Once the MovieService is depldoyed via tomee:run and the Grinder UI is triggered, then one can trigger a stress test. What I'm trying to understand: - How to simplify the stress part of the test to test against different databases. - I'm thinking to skip how to boot a docker Oracle database but I would like to hear feedback if the community think that needs it. - So far the Readme file explains how to switch from derby into Oracle. - I'm going to start adding resources.xml for each Database. During this PR review, I realized that we also need more XA examples for. I'm planning to open JIRAS also for: a) Using two databases (can be either the same DB or two different RDMS) within a global transaction. For example https://www.byteslounge.com/tutorials/ejb-multiple-datasource-transaction-example. Still, the debate on how to booth the Databases will be addressed. Aquillian Persistence extension could be also another alternative but still, the RDBMS should be up and running. b) Using one database and another resource like JMS within a global transaction. El mar., 18 jun. 2019 a las 7:45, Jonathan Gallimore (< [email protected]>) escribió: > Cesar > > I backported this to 1.7.x: https://github.com/apache/tomee/pull/489 > I think this and https://github.com/apache/tomee/pull/488 should be ready > for merge now. > > Can you review? If you're happy, I'll merge. > > We should start collecting some configs for different databases: > > Oracle > SQL Server > Postgres > MySQL > > and compare timings both with and without openejb.datasource.pool enabled > with both master and 1.7.x. > > If we see some "quality" issues along the way, I think we should call them > out. > > So, currently, with TomEE 8 (master) I have found that you *have* to > specify a JdbcUrl for the XA datasource otherwise TomEE follows the wrong > path and you end up with a HSQLDB connection. > > I also get warnings like this: > > 18-Jun-2019 14:41:41.583 WARNING [main] > org.apache.openejb.assembler.classic.Assembler.unusedProperty unused > property 'JdbcUrl' for resource 'dbtest/movieDatabase' > 18-Jun-2019 14:41:41.583 WARNING [main] > org.apache.openejb.assembler.classic.Assembler.unusedProperty unused > property 'UserName' for resource 'dbtest/movieDatabase' > 18-Jun-2019 14:41:41.584 WARNING [main] > org.apache.openejb.assembler.classic.Assembler.unusedProperty unused > property 'Password' for resource 'dbtest/movieDatabase' > 18-Jun-2019 14:41:41.584 WARNING [main] > org.apache.openejb.assembler.classic.Assembler.unusedProperty unused > property 'PasswordCipher' for resource 'dbtest/movieDatabase' > 18-Jun-2019 14:41:41.584 WARNING [main] > org.apache.openejb.assembler.classic.Assembler.unusedProperty unused > property 'ValidationQuery' for resource 'dbtest/movieDatabase' > 18-Jun-2019 14:41:41.585 WARNING [main] > org.apache.openejb.assembler.classic.Assembler.unusedProperty unused > property 'InitialSize' for resource 'dbtest/movieDatabase' > 18-Jun-2019 14:41:41.585 WARNING [main] > org.apache.openejb.assembler.classic.Assembler.unusedProperty unused > property 'MaxActive' for resource 'dbtest/movieDatabase' > 18-Jun-2019 14:41:41.585 WARNING [main] > org.apache.openejb.assembler.classic.Assembler.unusedProperty unused > property 'MaxIdle' for resource 'dbtest/movieDatabase' > 18-Jun-2019 14:41:41.585 WARNING [main] > org.apache.openejb.assembler.classic.Assembler.unusedProperty unused > property 'MinIdle' for resource 'dbtest/movieDatabase' > 18-Jun-2019 14:41:41.585 WARNING [main] > org.apache.openejb.assembler.classic.Assembler.unusedProperty unused > property 'TestWhileIdle' for resource 'dbtest/movieDatabase' > 18-Jun-2019 14:41:41.586 WARNING [main] > org.apache.openejb.assembler.classic.Assembler.unusedProperty unused > property 'TestOnBorrow' for resource 'dbtest/movieDatabase' > 18-Jun-2019 14:41:41.586 WARNING [main] > org.apache.openejb.assembler.classic.Assembler.unusedProperty unused > property 'TestOnReturn' for resource 'dbtest/movieDatabase' > 18-Jun-2019 14:41:41.586 WARNING [main] > org.apache.openejb.assembler.classic.Assembler.unusedProperty unused > property 'AccessToUnderlyingConnectionAllowed' for resource > 'dbtest/movieDatabase' > 18-Jun-2019 14:41:41.586 WARNING [main] > org.apache.openejb.assembler.classic.Assembler.unusedProperty unused > property 'PoolPreparedStatements' for resource 'dbtest/movieDatabase' > 18-Jun-2019 14:41:41.586 WARNING [main] > org.apache.openejb.assembler.classic.Assembler.unusedProperty unused > property 'MaxOpenPreparedStatements' for resource 'dbtest/movieDatabase' > > which may be accurate, but I'd like to pin down where they are coming from > and try and provide something more helpful. > > Finally, configuring XA datasources generally feels a bit painful. It would > be nice have a tool that can help build the config for you. > > Jon > > On Tue, Jun 18, 2019 at 11:14 AM Jonathan Gallimore < > [email protected]> wrote: > > > Hi Cesar > > > > I had a go with your XA sample PR. I've picked it up and expanded on it: > > https://github.com/apache/tomee/pull/488 > > > > Can you take a look and see what you think? I've removed any references > to > > ojdbc jar, and tweaked so the jars for the Grinder framework aren't > > committed to the repository. Out of the box, it runs with Derby, but I > > think providing instructions for Oracle, SQL Server, etc would be > > worthwhile so people can run their own tests against different databases. > > > > Thanks > > > > Jon > > > -- Atentamente: César Hernández.
