Re: HA-JDBC via tomee.xml Resource factory/cluster properties ignored
Well, they have their own implementation of Romain there though. His name is Paul. Lol On Nov 5, 2013 12:55 AM, Jean-Louis MONTEIRO jeano...@gmail.com wrote: Lol Romain isn't a committee on HA Jdbc. Le 5 nov. 2013 06:08, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : FYI/followup, On Sat, Nov 2, 2013 at 9:49 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: I'm trying to use HA-JDBC[1] with TomEE to have a cluster of at least 2 databases. I had to do the following to ensure tomee would create the ha-jdbc resource: 1. add the following java option -Dha-jdbc.configuration=file:/apache-tomee-plus-1.6.0-SNAPSHOT/lib/ha-jdbc-cluster.xml 2. tomee.xml contains the following !-- # create/reference embedded derby driver at startup, # so the driver can be referenced when ha-jdbc resource is created -- Resource id=jdbc/startup type=javax.sql.DataSource JdbcDriver org.apache.derby.jdbc.EmbeddedDriver JdbcUrl jdbc:derby:C:/javadb/databases/startup;create=true UserName Password JtaManaged false jmxEnabled false LogSql false ignoreDefaultValues true /Resource Resource id=jdbc/mcmsJta type=javax.sql.DataSource JdbcDriver net.sf.hajdbc.sql.Driver JdbcUrl jdbc:ha-jdbc:cluster UserName Password JtaManaged true jmxEnabled false LogSql false InitialSize 10 MaxActive 100 MaxIdle 30 MaxWait 1 minIdle 10 suspectTimeout 60 removeAbandoned true removeAbandonedTimeout 180 timeBetweenEvictionRunsMillis 3 jdbcInterceptors=StatementCache(max=128) /Resource 3. ha-jdbc-cluster.xml (located in tomee/lib) ?xml version=1.0 encoding=UTF-8? ha-jdbc xmlns=urn:ha-jdbc:cluster:2.1 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://ha-jdbc.github.io/xsd/ha-jdbc-2.1.0-beta-4.xsd; sync id=full property name=fetchSize1000/property /sync sync id=diff property name=fetchSize1000/property property name=versionPatternversion/property /sync state id=simple/ cluster dialect=derby balancer=simple default-sync=full meta-data-cache=lazy transaction-mode=parallel database id=db1 weight=1 location=jdbc:derby:c:/javadb/databases/mcms;create=true user/user password/password property name=databaseNamemcms/property property name=driverorg.apache.derby.jdbc.EmbeddedDriver/property /database database id=db2 weight=2 location=jdbc:derby:c:/javadb/databases/mcmsdev;create=true user/user password/password property name=databaseNamemcms/property property name=driverorg.apache.derby.jdbc.EmbeddedDriver/property /database /cluster /ha-jdbc 4. drop ha-jdbc-2.1.0-beta-4.jar (and ha-jdbc-2.1.0-beta-4.xsd) in tomee/lib SQL SELECTs are working as expected, but i'm seeking advice (in the ha-jdbc forum) on how to configure ha-jdbc for multiple table-and-row INSERTs. :)
Re: HA-JDBC via tomee.xml Resource factory/cluster properties ignored
FYI/followup, On Sat, Nov 2, 2013 at 9:49 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: I'm trying to use HA-JDBC[1] with TomEE to have a cluster of at least 2 databases. I had to do the following to ensure tomee would create the ha-jdbc resource: 1. add the following java option -Dha-jdbc.configuration=file:/apache-tomee-plus-1.6.0-SNAPSHOT/lib/ha-jdbc-cluster.xml 2. tomee.xml contains the following !-- # create/reference embedded derby driver at startup, # so the driver can be referenced when ha-jdbc resource is created -- Resource id=jdbc/startup type=javax.sql.DataSource JdbcDriver org.apache.derby.jdbc.EmbeddedDriver JdbcUrl jdbc:derby:C:/javadb/databases/startup;create=true UserName Password JtaManaged false jmxEnabled false LogSql false ignoreDefaultValues true /Resource Resource id=jdbc/mcmsJta type=javax.sql.DataSource JdbcDriver net.sf.hajdbc.sql.Driver JdbcUrl jdbc:ha-jdbc:cluster UserName Password JtaManaged true jmxEnabled false LogSql false InitialSize 10 MaxActive 100 MaxIdle 30 MaxWait 1 minIdle 10 suspectTimeout 60 removeAbandoned true removeAbandonedTimeout 180 timeBetweenEvictionRunsMillis 3 jdbcInterceptors=StatementCache(max=128) /Resource 3. ha-jdbc-cluster.xml (located in tomee/lib) ?xml version=1.0 encoding=UTF-8? ha-jdbc xmlns=urn:ha-jdbc:cluster:2.1 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://ha-jdbc.github.io/xsd/ha-jdbc-2.1.0-beta-4.xsd; sync id=full property name=fetchSize1000/property /sync sync id=diff property name=fetchSize1000/property property name=versionPatternversion/property /sync state id=simple/ cluster dialect=derby balancer=simple default-sync=full meta-data-cache=lazy transaction-mode=parallel database id=db1 weight=1 location=jdbc:derby:c:/javadb/databases/mcms;create=true user/user password/password property name=databaseNamemcms/property property name=driverorg.apache.derby.jdbc.EmbeddedDriver/property /database database id=db2 weight=2 location=jdbc:derby:c:/javadb/databases/mcmsdev;create=true user/user password/password property name=databaseNamemcms/property property name=driverorg.apache.derby.jdbc.EmbeddedDriver/property /database /cluster /ha-jdbc 4. drop ha-jdbc-2.1.0-beta-4.jar (and ha-jdbc-2.1.0-beta-4.xsd) in tomee/lib SQL SELECTs are working as expected, but i'm seeking advice (in the ha-jdbc forum) on how to configure ha-jdbc for multiple table-and-row INSERTs. :)
Re: HA-JDBC via tomee.xml Resource factory/cluster properties ignored
Lol Romain isn't a committee on HA Jdbc. Le 5 nov. 2013 06:08, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : FYI/followup, On Sat, Nov 2, 2013 at 9:49 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: I'm trying to use HA-JDBC[1] with TomEE to have a cluster of at least 2 databases. I had to do the following to ensure tomee would create the ha-jdbc resource: 1. add the following java option -Dha-jdbc.configuration=file:/apache-tomee-plus-1.6.0-SNAPSHOT/lib/ha-jdbc-cluster.xml 2. tomee.xml contains the following !-- # create/reference embedded derby driver at startup, # so the driver can be referenced when ha-jdbc resource is created -- Resource id=jdbc/startup type=javax.sql.DataSource JdbcDriver org.apache.derby.jdbc.EmbeddedDriver JdbcUrl jdbc:derby:C:/javadb/databases/startup;create=true UserName Password JtaManaged false jmxEnabled false LogSql false ignoreDefaultValues true /Resource Resource id=jdbc/mcmsJta type=javax.sql.DataSource JdbcDriver net.sf.hajdbc.sql.Driver JdbcUrl jdbc:ha-jdbc:cluster UserName Password JtaManaged true jmxEnabled false LogSql false InitialSize 10 MaxActive 100 MaxIdle 30 MaxWait 1 minIdle 10 suspectTimeout 60 removeAbandoned true removeAbandonedTimeout 180 timeBetweenEvictionRunsMillis 3 jdbcInterceptors=StatementCache(max=128) /Resource 3. ha-jdbc-cluster.xml (located in tomee/lib) ?xml version=1.0 encoding=UTF-8? ha-jdbc xmlns=urn:ha-jdbc:cluster:2.1 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://ha-jdbc.github.io/xsd/ha-jdbc-2.1.0-beta-4.xsd; sync id=full property name=fetchSize1000/property /sync sync id=diff property name=fetchSize1000/property property name=versionPatternversion/property /sync state id=simple/ cluster dialect=derby balancer=simple default-sync=full meta-data-cache=lazy transaction-mode=parallel database id=db1 weight=1 location=jdbc:derby:c:/javadb/databases/mcms;create=true user/user password/password property name=databaseNamemcms/property property name=driverorg.apache.derby.jdbc.EmbeddedDriver/property /database database id=db2 weight=2 location=jdbc:derby:c:/javadb/databases/mcmsdev;create=true user/user password/password property name=databaseNamemcms/property property name=driverorg.apache.derby.jdbc.EmbeddedDriver/property /database /cluster /ha-jdbc 4. drop ha-jdbc-2.1.0-beta-4.jar (and ha-jdbc-2.1.0-beta-4.xsd) in tomee/lib SQL SELECTs are working as expected, but i'm seeking advice (in the ha-jdbc forum) on how to configure ha-jdbc for multiple table-and-row INSERTs. :)
Re: HA-JDBC via tomee.xml Resource factory/cluster properties ignored
No idea why you have a NPE but do you know http://rmannibucau.wordpress.com/2013/04/26/tomeeopenejb-and-failover-of-datasources/? Isnt it what you desire more or less? Le 3 nov. 2013 05:11, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : trying to get it done via tomee.xml, ha-jdbc-cluster.xml, and java option -Dha-jdbc... seems to help, but i definitely need help...i been reporting my progress with this on ha-jdbc forum[1]... i hope to get some help with this, soon. [1] https://sourceforge.net/p/ha-jdbc/discussion/383396/thread/5f4dc302/ On Sat, Nov 2, 2013 at 3:44 PM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: okay, I'm seeing what you said (not get jta as easily, when using context.xml). thanks. On Sat, Nov 2, 2013 at 3:39 PM, Romain Manni-Bucau rmannibu...@gmail.comwrote: If you use context.xml youll not get as easily jta. You can set Resource attribute class-name to the impl class and setXxx using xxx as property attribute (factory for instance) Le 2 nov. 2013 18:10, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : Per [Avoid properties conflict when configuring TomEE DataSource][1], I added ignoreDefaultValues=true to Resource in tomee.xml, Resource id=jdbc/mcmsJta type=javax.sql.DataSource JdbcDriver net.sf.hajdbc.sql.DataSource IgnoreDefaultValues true JtaManaged true jmxEnabled true LogSql false /Resource and the result are the [exceptions in the log file][2]. the exceptions seem to prove that I need to add the following to Resource .../ cluster=... factory=... can you please advise how I can add these two parameters to Resource .../ in tomee.xml, or should I revert to META-INF/context.xml? [1]: http://rmannibucau.wordpress.com/2012/11/08/avoid-properties-conflict-when-configuring-tomee-datasource/ [2]: https://gist.github.com/smithh032772/7279765#file-log3-txt On Sat, Nov 2, 2013 at 11:09 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Why workaround? That how it works
Re: HA-JDBC via tomee.xml Resource factory/cluster properties ignored
I believe that is exactly what I want. I wish I knew about that earlier, so I could have tried that earlier, and my preference is to do /use the tomee easy way, always, and as much as possible. Thanks Romain. I like the dynamic datasources too. Is there a test case (on trunk) available for both the fail over and dynamic datasources, separately, so I can evaluate both? Please reply with URL of those test cases, if available. Thanks. If I may ask, was this added to tomee after seeing tomee users mentioning or interested in something like this. Definitely a great idea and feature to add to the great tomee. :-) On Nov 3, 2013 3:15 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: No idea why you have a NPE but do you know http://rmannibucau.wordpress.com/2013/04/26/tomeeopenejb-and-failover-of-datasources/ ? Isnt it what you desire more or less? Le 3 nov. 2013 05:11, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : trying to get it done via tomee.xml, ha-jdbc-cluster.xml, and java option -Dha-jdbc... seems to help, but i definitely need help...i been reporting my progress with this on ha-jdbc forum[1]... i hope to get some help with this, soon. [1] https://sourceforge.net/p/ha-jdbc/discussion/383396/thread/5f4dc302/ On Sat, Nov 2, 2013 at 3:44 PM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: okay, I'm seeing what you said (not get jta as easily, when using context.xml). thanks. On Sat, Nov 2, 2013 at 3:39 PM, Romain Manni-Bucau rmannibu...@gmail.comwrote: If you use context.xml youll not get as easily jta. You can set Resource attribute class-name to the impl class and setXxx using xxx as property attribute (factory for instance) Le 2 nov. 2013 18:10, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : Per [Avoid properties conflict when configuring TomEE DataSource][1], I added ignoreDefaultValues=true to Resource in tomee.xml, Resource id=jdbc/mcmsJta type=javax.sql.DataSource JdbcDriver net.sf.hajdbc.sql.DataSource IgnoreDefaultValues true JtaManaged true jmxEnabled true LogSql false /Resource and the result are the [exceptions in the log file][2]. the exceptions seem to prove that I need to add the following to Resource .../ cluster=... factory=... can you please advise how I can add these two parameters to Resource .../ in tomee.xml, or should I revert to META-INF/context.xml? [1]: http://rmannibucau.wordpress.com/2012/11/08/avoid-properties-conflict-when-configuring-tomee-datasource/ [2]: https://gist.github.com/smithh032772/7279765#file-log3-txt On Sat, Nov 2, 2013 at 11:09 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Why workaround? That how it works
Re: HA-JDBC via tomee.xml Resource factory/cluster properties ignored
okay, i just found this on tomee examples page, http://tomee.apache.org/examples-trunk/dynamic-datasource-routing/README.html On Sun, Nov 3, 2013 at 5:46 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: I believe that is exactly what I want. I wish I knew about that earlier, so I could have tried that earlier, and my preference is to do /use the tomee easy way, always, and as much as possible. Thanks Romain. I like the dynamic datasources too. Is there a test case (on trunk) available for both the fail over and dynamic datasources, separately, so I can evaluate both? Please reply with URL of those test cases, if available. Thanks. If I may ask, was this added to tomee after seeing tomee users mentioning or interested in something like this. Definitely a great idea and feature to add to the great tomee. :-) On Nov 3, 2013 3:15 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: No idea why you have a NPE but do you know http://rmannibucau.wordpress.com/2013/04/26/tomeeopenejb-and-failover-of-datasources/ ? Isnt it what you desire more or less? Le 3 nov. 2013 05:11, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : trying to get it done via tomee.xml, ha-jdbc-cluster.xml, and java option -Dha-jdbc... seems to help, but i definitely need help...i been reporting my progress with this on ha-jdbc forum[1]... i hope to get some help with this, soon. [1] https://sourceforge.net/p/ha-jdbc/discussion/383396/thread/5f4dc302/ On Sat, Nov 2, 2013 at 3:44 PM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: okay, I'm seeing what you said (not get jta as easily, when using context.xml). thanks. On Sat, Nov 2, 2013 at 3:39 PM, Romain Manni-Bucau rmannibu...@gmail.comwrote: If you use context.xml youll not get as easily jta. You can set Resource attribute class-name to the impl class and setXxx using xxx as property attribute (factory for instance) Le 2 nov. 2013 18:10, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : Per [Avoid properties conflict when configuring TomEE DataSource][1], I added ignoreDefaultValues=true to Resource in tomee.xml, Resource id=jdbc/mcmsJta type=javax.sql.DataSource JdbcDriver net.sf.hajdbc.sql.DataSource IgnoreDefaultValues true JtaManaged true jmxEnabled true LogSql false /Resource and the result are the [exceptions in the log file][2]. the exceptions seem to prove that I need to add the following to Resource .../ cluster=... factory=... can you please advise how I can add these two parameters to Resource .../ in tomee.xml, or should I revert to META-INF/context.xml? [1]: http://rmannibucau.wordpress.com/2012/11/08/avoid-properties-conflict-when-configuring-tomee-datasource/ [2]: https://gist.github.com/smithh032772/7279765#file-log3-txt On Sat, Nov 2, 2013 at 11:09 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Why workaround? That how it works
HA-JDBC via tomee.xml Resource factory/cluster properties ignored
I'm trying to use HA-JDBC[1] with TomEE to have a cluster of at least 2 databases. As per documentation and forum discussion, I have the following: --- tomee.xml --- Resource id=jdbc/mcmsJta type=javax.sql.DataSource factory=net.sf.hajdbc.sql.DataSourceFactory cluster=cluster UserName Password ... JtaManaged true jmxEnabled true LogSql false /Resource --- ha-jdbc-cluster.xml --- ?xml version=1.0 encoding=UTF-8? ha-jdbc xmlns=urn:ha-jdbc:cluster:2.1 sync id=full property name=fetchSize1000/property /sync sync id=diff property name=fetchSize1000/property property name=versionPatternversion/property /sync state id=simple/ cluster dialect=derby balancer=simple default-sync=full meta-data-cache=lazy transaction-mode=parallel database id=db1 weight=1 location=org.apache.tomcat.jdbc.pool.DataSource user.../user password.../password property name=serverNamemcms/property property name=databaseNamemcms/property property name=driverorg.apache.derby.jdbc.EmbeddedDriver/property property name=urljdbc:derby:c:/javadb/databases/mcms;create=true/property property name=InitialSize10/property property name=MaxActive100/property property name=MaxIdle30/property property name=MaxWait1/property property name=minIdle10/property property name=suspectTimeout60/property property name=removeAbandonedtrue/property property name=removeAbandonedTimeout180/property property name=timeBetweenEvictionRunsMillis3/property property name=jdbcInterceptorsStatementCache(max=128)/property /database database id=db2 weight=2 location=org.apache.tomcat.jdbc.pool.DataSource user.../user password.../password property name=serverNamemcms/property property name=databaseNamemcms/property property name=driverorg.apache.derby.jdbc.EmbeddedDriver/property property name=urljdbc:derby:c:/javadb/databases/mcmsdev;create=true/property property name=InitialSize10/property property name=MaxActive100/property property name=MaxIdle30/property property name=MaxWait1/property property name=minIdle10/property property name=suspectTimeout60/property property name=removeAbandonedtrue/property property name=removeAbandonedTimeout180/property property name=timeBetweenEvictionRunsMillis3/property property name=jdbcInterceptorsStatementCache(max=128)/property /database /cluster /ha-jdbc which results in the following in the log: INFO: Creating Resource(id=jdbc/mcmsJta) Nov 02, 2013 9:15:03 AM org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource readOnly INFO: Disabling testOnBorrow since no validation query is provided Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler logUnusedProperties WARNING: Property factory not supported by jdbc/mcmsJta Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler logUnusedProperties WARNING: Property cluster not supported by jdbc/mcmsJta Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler createRecipe now, my app is not connecting to my database, and it is trying to use default database connection (hsqldb, which is probably the non-jta database which is configured automatically by tomee, if/when 'no' non-jta database is configured/specified in tomee.xml via Resource ... /. Should I move the Resource .../ from tomee.xml to (webapp) META-INF/context.xml as recommended here[2]? [1] http://ha-jdbc.github.io/ [2] https://sourceforge.net/p/ha-jdbc/discussion/383396/thread/4707f208/
Re: HA-JDBC via tomee.xml Resource factory/cluster properties ignored
The following is the workaround: Resource id=jdbc/mcmsJta type=javax.sql.DataSource JdbcDriver net.sf.hajdbc.sql.DataSource UserName Password JtaManaged true jmxEnabled true LogSql false /Resource and had to rename filename from ha-jdbc-cluster.xml to ha-jdbc-null.xml. still getting errors, but they are related to ha-jdbc, now. On Sat, Nov 2, 2013 at 9:49 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: I'm trying to use HA-JDBC[1] with TomEE to have a cluster of at least 2 databases. As per documentation and forum discussion, I have the following: --- tomee.xml --- Resource id=jdbc/mcmsJta type=javax.sql.DataSource factory=net.sf.hajdbc.sql.DataSourceFactory cluster=cluster UserName Password ... JtaManaged true jmxEnabled true LogSql false /Resource --- ha-jdbc-cluster.xml --- ?xml version=1.0 encoding=UTF-8? ha-jdbc xmlns=urn:ha-jdbc:cluster:2.1 sync id=full property name=fetchSize1000/property /sync sync id=diff property name=fetchSize1000/property property name=versionPatternversion/property /sync state id=simple/ cluster dialect=derby balancer=simple default-sync=full meta-data-cache=lazy transaction-mode=parallel database id=db1 weight=1 location=org.apache.tomcat.jdbc.pool.DataSource user.../user password.../password property name=serverNamemcms/property property name=databaseNamemcms/property property name=driverorg.apache.derby.jdbc.EmbeddedDriver/property property name=urljdbc:derby:c:/javadb/databases/mcms;create=true/property property name=InitialSize10/property property name=MaxActive100/property property name=MaxIdle30/property property name=MaxWait1/property property name=minIdle10/property property name=suspectTimeout60/property property name=removeAbandonedtrue/property property name=removeAbandonedTimeout180/property property name=timeBetweenEvictionRunsMillis3/property property name=jdbcInterceptorsStatementCache(max=128)/property /database database id=db2 weight=2 location=org.apache.tomcat.jdbc.pool.DataSource user.../user password.../password property name=serverNamemcms/property property name=databaseNamemcms/property property name=driverorg.apache.derby.jdbc.EmbeddedDriver/property property name=urljdbc:derby:c:/javadb/databases/mcmsdev;create=true/property property name=InitialSize10/property property name=MaxActive100/property property name=MaxIdle30/property property name=MaxWait1/property property name=minIdle10/property property name=suspectTimeout60/property property name=removeAbandonedtrue/property property name=removeAbandonedTimeout180/property property name=timeBetweenEvictionRunsMillis3/property property name=jdbcInterceptorsStatementCache(max=128)/property /database /cluster /ha-jdbc which results in the following in the log: INFO: Creating Resource(id=jdbc/mcmsJta) Nov 02, 2013 9:15:03 AM org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource readOnly INFO: Disabling testOnBorrow since no validation query is provided Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler logUnusedProperties WARNING: Property factory not supported by jdbc/mcmsJta Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler logUnusedProperties WARNING: Property cluster not supported by jdbc/mcmsJta Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler createRecipe now, my app is not connecting to my database, and it is trying to use default database connection (hsqldb, which is probably the non-jta database which is configured automatically by tomee, if/when 'no' non-jta database is configured/specified in tomee.xml via Resource ... /. Should I move the Resource .../ from tomee.xml to (webapp) META-INF/context.xml as recommended here[2]? [1] http://ha-jdbc.github.io/ [2] https://sourceforge.net/p/ha-jdbc/discussion/383396/thread/4707f208/
Re: HA-JDBC via tomee.xml Resource factory/cluster properties ignored
Why workaround? That how it works Le 2 nov. 2013 15:48, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : The following is the workaround: Resource id=jdbc/mcmsJta type=javax.sql.DataSource JdbcDriver net.sf.hajdbc.sql.DataSource UserName Password JtaManaged true jmxEnabled true LogSql false /Resource and had to rename filename from ha-jdbc-cluster.xml to ha-jdbc-null.xml. still getting errors, but they are related to ha-jdbc, now. On Sat, Nov 2, 2013 at 9:49 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: I'm trying to use HA-JDBC[1] with TomEE to have a cluster of at least 2 databases. As per documentation and forum discussion, I have the following: --- tomee.xml --- Resource id=jdbc/mcmsJta type=javax.sql.DataSource factory=net.sf.hajdbc.sql.DataSourceFactory cluster=cluster UserName Password ... JtaManaged true jmxEnabled true LogSql false /Resource --- ha-jdbc-cluster.xml --- ?xml version=1.0 encoding=UTF-8? ha-jdbc xmlns=urn:ha-jdbc:cluster:2.1 sync id=full property name=fetchSize1000/property /sync sync id=diff property name=fetchSize1000/property property name=versionPatternversion/property /sync state id=simple/ cluster dialect=derby balancer=simple default-sync=full meta-data-cache=lazy transaction-mode=parallel database id=db1 weight=1 location=org.apache.tomcat.jdbc.pool.DataSource user.../user password.../password property name=serverNamemcms/property property name=databaseNamemcms/property property name=driverorg.apache.derby.jdbc.EmbeddedDriver/property property name=urljdbc:derby:c:/javadb/databases/mcms;create=true/property property name=InitialSize10/property property name=MaxActive100/property property name=MaxIdle30/property property name=MaxWait1/property property name=minIdle10/property property name=suspectTimeout60/property property name=removeAbandonedtrue/property property name=removeAbandonedTimeout180/property property name=timeBetweenEvictionRunsMillis3/property property name=jdbcInterceptorsStatementCache(max=128)/property /database database id=db2 weight=2 location=org.apache.tomcat.jdbc.pool.DataSource user.../user password.../password property name=serverNamemcms/property property name=databaseNamemcms/property property name=driverorg.apache.derby.jdbc.EmbeddedDriver/property property name=urljdbc:derby:c:/javadb/databases/mcmsdev;create=true/property property name=InitialSize10/property property name=MaxActive100/property property name=MaxIdle30/property property name=MaxWait1/property property name=minIdle10/property property name=suspectTimeout60/property property name=removeAbandonedtrue/property property name=removeAbandonedTimeout180/property property name=timeBetweenEvictionRunsMillis3/property property name=jdbcInterceptorsStatementCache(max=128)/property /database /cluster /ha-jdbc which results in the following in the log: INFO: Creating Resource(id=jdbc/mcmsJta) Nov 02, 2013 9:15:03 AM org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource readOnly INFO: Disabling testOnBorrow since no validation query is provided Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler logUnusedProperties WARNING: Property factory not supported by jdbc/mcmsJta Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler logUnusedProperties WARNING: Property cluster not supported by jdbc/mcmsJta Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler createRecipe now, my app is not connecting to my database, and it is trying to use default database connection (hsqldb, which is probably the non-jta database which is configured automatically by tomee, if/when 'no' non-jta database is configured/specified in tomee.xml via Resource ... /. Should I move the Resource .../ from tomee.xml to (webapp) META-INF/context.xml as recommended here[2]? [1] http://ha-jdbc.github.io/ [2] https://sourceforge.net/p/ha-jdbc/discussion/383396/thread/4707f208/
Re: HA-JDBC via tomee.xml Resource factory/cluster properties ignored
now, i know, thanks! :) On Sat, Nov 2, 2013 at 11:09 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Why workaround? That how it works Le 2 nov. 2013 15:48, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : The following is the workaround: Resource id=jdbc/mcmsJta type=javax.sql.DataSource JdbcDriver net.sf.hajdbc.sql.DataSource UserName Password JtaManaged true jmxEnabled true LogSql false /Resource and had to rename filename from ha-jdbc-cluster.xml to ha-jdbc-null.xml. still getting errors, but they are related to ha-jdbc, now. On Sat, Nov 2, 2013 at 9:49 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: I'm trying to use HA-JDBC[1] with TomEE to have a cluster of at least 2 databases. As per documentation and forum discussion, I have the following: --- tomee.xml --- Resource id=jdbc/mcmsJta type=javax.sql.DataSource factory=net.sf.hajdbc.sql.DataSourceFactory cluster=cluster UserName Password ... JtaManaged true jmxEnabled true LogSql false /Resource --- ha-jdbc-cluster.xml --- ?xml version=1.0 encoding=UTF-8? ha-jdbc xmlns=urn:ha-jdbc:cluster:2.1 sync id=full property name=fetchSize1000/property /sync sync id=diff property name=fetchSize1000/property property name=versionPatternversion/property /sync state id=simple/ cluster dialect=derby balancer=simple default-sync=full meta-data-cache=lazy transaction-mode=parallel database id=db1 weight=1 location=org.apache.tomcat.jdbc.pool.DataSource user.../user password.../password property name=serverNamemcms/property property name=databaseNamemcms/property property name=driverorg.apache.derby.jdbc.EmbeddedDriver/property property name=urljdbc:derby:c:/javadb/databases/mcms;create=true/property property name=InitialSize10/property property name=MaxActive100/property property name=MaxIdle30/property property name=MaxWait1/property property name=minIdle10/property property name=suspectTimeout60/property property name=removeAbandonedtrue/property property name=removeAbandonedTimeout180/property property name=timeBetweenEvictionRunsMillis3/property property name=jdbcInterceptorsStatementCache(max=128)/property /database database id=db2 weight=2 location=org.apache.tomcat.jdbc.pool.DataSource user.../user password.../password property name=serverNamemcms/property property name=databaseNamemcms/property property name=driverorg.apache.derby.jdbc.EmbeddedDriver/property property name=urljdbc:derby:c:/javadb/databases/mcmsdev;create=true/property property name=InitialSize10/property property name=MaxActive100/property property name=MaxIdle30/property property name=MaxWait1/property property name=minIdle10/property property name=suspectTimeout60/property property name=removeAbandonedtrue/property property name=removeAbandonedTimeout180/property property name=timeBetweenEvictionRunsMillis3/property property name=jdbcInterceptorsStatementCache(max=128)/property /database /cluster /ha-jdbc which results in the following in the log: INFO: Creating Resource(id=jdbc/mcmsJta) Nov 02, 2013 9:15:03 AM org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource readOnly INFO: Disabling testOnBorrow since no validation query is provided Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler logUnusedProperties WARNING: Property factory not supported by jdbc/mcmsJta Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler logUnusedProperties WARNING: Property cluster not supported by jdbc/mcmsJta Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler createRecipe now, my app is not connecting to my database, and it is trying to use default database connection (hsqldb, which is probably the non-jta database which is configured automatically by tomee, if/when 'no' non-jta database is configured/specified in tomee.xml via Resource ... /. Should I move the Resource .../ from tomee.xml to (webapp) META-INF/context.xml as recommended here[2]? [1] http://ha-jdbc.github.io/ [2] https://sourceforge.net/p/ha-jdbc/discussion/383396/thread/4707f208/
Re: HA-JDBC via tomee.xml Resource factory/cluster properties ignored
Per [Avoid properties conflict when configuring TomEE DataSource][1], I added ignoreDefaultValues=true to Resource in tomee.xml, Resource id=jdbc/mcmsJta type=javax.sql.DataSource JdbcDriver net.sf.hajdbc.sql.DataSource IgnoreDefaultValues true JtaManaged true jmxEnabled true LogSql false /Resource and the result are the [exceptions in the log file][2]. the exceptions seem to prove that I need to add the following to Resource .../ cluster=... factory=... can you please advise how I can add these two parameters to Resource .../ in tomee.xml, or should I revert to META-INF/context.xml? [1]: http://rmannibucau.wordpress.com/2012/11/08/avoid-properties-conflict-when-configuring-tomee-datasource/ [2]: https://gist.github.com/smithh032772/7279765#file-log3-txt On Sat, Nov 2, 2013 at 11:09 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Why workaround? That how it works
Re: HA-JDBC via tomee.xml Resource factory/cluster properties ignored
okay, I'm seeing what you said (not get jta as easily, when using context.xml). thanks. On Sat, Nov 2, 2013 at 3:39 PM, Romain Manni-Bucau rmannibu...@gmail.comwrote: If you use context.xml youll not get as easily jta. You can set Resource attribute class-name to the impl class and setXxx using xxx as property attribute (factory for instance) Le 2 nov. 2013 18:10, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : Per [Avoid properties conflict when configuring TomEE DataSource][1], I added ignoreDefaultValues=true to Resource in tomee.xml, Resource id=jdbc/mcmsJta type=javax.sql.DataSource JdbcDriver net.sf.hajdbc.sql.DataSource IgnoreDefaultValues true JtaManaged true jmxEnabled true LogSql false /Resource and the result are the [exceptions in the log file][2]. the exceptions seem to prove that I need to add the following to Resource .../ cluster=... factory=... can you please advise how I can add these two parameters to Resource .../ in tomee.xml, or should I revert to META-INF/context.xml? [1]: http://rmannibucau.wordpress.com/2012/11/08/avoid-properties-conflict-when-configuring-tomee-datasource/ [2]: https://gist.github.com/smithh032772/7279765#file-log3-txt On Sat, Nov 2, 2013 at 11:09 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Why workaround? That how it works
Re: HA-JDBC via tomee.xml Resource factory/cluster properties ignored
trying to get it done via tomee.xml, ha-jdbc-cluster.xml, and java option -Dha-jdbc... seems to help, but i definitely need help...i been reporting my progress with this on ha-jdbc forum[1]... i hope to get some help with this, soon. [1] https://sourceforge.net/p/ha-jdbc/discussion/383396/thread/5f4dc302/ On Sat, Nov 2, 2013 at 3:44 PM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: okay, I'm seeing what you said (not get jta as easily, when using context.xml). thanks. On Sat, Nov 2, 2013 at 3:39 PM, Romain Manni-Bucau rmannibu...@gmail.comwrote: If you use context.xml youll not get as easily jta. You can set Resource attribute class-name to the impl class and setXxx using xxx as property attribute (factory for instance) Le 2 nov. 2013 18:10, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : Per [Avoid properties conflict when configuring TomEE DataSource][1], I added ignoreDefaultValues=true to Resource in tomee.xml, Resource id=jdbc/mcmsJta type=javax.sql.DataSource JdbcDriver net.sf.hajdbc.sql.DataSource IgnoreDefaultValues true JtaManaged true jmxEnabled true LogSql false /Resource and the result are the [exceptions in the log file][2]. the exceptions seem to prove that I need to add the following to Resource .../ cluster=... factory=... can you please advise how I can add these two parameters to Resource .../ in tomee.xml, or should I revert to META-INF/context.xml? [1]: http://rmannibucau.wordpress.com/2012/11/08/avoid-properties-conflict-when-configuring-tomee-datasource/ [2]: https://gist.github.com/smithh032772/7279765#file-log3-txt On Sat, Nov 2, 2013 at 11:09 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Why workaround? That how it works