You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Romain Manni-Bucau <rm...@gmail.com> on 2012/07/25 22:41:40 UTC

default tomee ds pool

Hi,

if you didnt follow: i created a branch openejb-pool where i hacked to be
able to switch our dbcp pool

currently there is dbcp (old one) intergation, tomcat-jdbc one and a bonecp
one but not packaged in any distribution.

Well now the question is: do we keep dbcp as default even for tomee?

- Romain

Re: default tomee ds pool

Posted by Romain Manni-Bucau <rm...@gmail.com>.
you use JPA?

there is the jta datasource and the non jta datasource. TomEE configures
both by default, maybe that's the second one. Check logs you should get
some auto creating resource or message close to it

- Romain


2012/8/9 zeeman <ha...@fastmail.us>

> Thanks boss! It worked after removing quotes :), already identified 40 slow
> queries in the app. However, I still see warnings:
>
> WARNING: Tomcat-jdbc doesn't support 'MaxOpenPreparedStatements' property,
> please configure the StatementCache jdbc interceptor
> Aug 9, 2012 2:51:35 PM org.apache.tomee.jdbc.TomEEDataSourceCreator
> updateProperties
> WARNING: Tomcat-jdbc doesn't support 'PoolPreparedStatements' property,
> please configure the StatementCache jdbc interceptor
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656761.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: default tomee ds pool

Posted by zeeman <ha...@fastmail.us>.
Thanks boss! It worked after removing quotes :), already identified 40 slow
queries in the app. However, I still see warnings:

WARNING: Tomcat-jdbc doesn't support 'MaxOpenPreparedStatements' property,
please configure the StatementCache jdbc interceptor
Aug 9, 2012 2:51:35 PM org.apache.tomee.jdbc.TomEEDataSourceCreator
updateProperties
WARNING: Tomcat-jdbc doesn't support 'PoolPreparedStatements' property,
please configure the StatementCache jdbc interceptor



--
View this message in context: http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656761.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: default tomee ds pool

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Tomee.xml is the way to go. If no tomee.xml is found we use openejb.xml. it
is just a fallback because it was like it before tomee.

For recent application dont use it IMO
Le 10 août 2012 02:43, "zeeman" <ha...@fastmail.us> a écrit :

> = sign does not matter.
>
> After I commented out the hsql data sources you mentioned under openejb.xml
> from Eclipse tomcat plugin warnings went away. So I'm guessing if I use a
> tomcat pool with those DS the warnings should go away. Right?
>
> Why under Eclipse tomcat plugin I see openejb.xml, but under tomee
> installation I see tomee.xml?
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656771.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: default tomee ds pool

Posted by zeeman <ha...@fastmail.us>.
= sign does not matter.

After I commented out the hsql data sources you mentioned under openejb.xml
from Eclipse tomcat plugin warnings went away. So I'm guessing if I use a
tomcat pool with those DS the warnings should go away. Right?

Why under Eclipse tomcat plugin I see openejb.xml, but under tomee
installation I see tomee.xml?



--
View this message in context: http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656771.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: default tomee ds pool

Posted by Romain Manni-Bucau <rm...@gmail.com>.
  <Resource id="jdbc/blog" type="javax.sql.DataSource">
    JdbcDriver = org.hsqldb.jdbcDriver
    JdbcUrl = jdbc:hsqldb:mem:blog
    UserName = SA
    Password =
    JtaManaged = true
  </Resource>


  <Resource id="jdbc/blog-unmanaged" type="javax.sql.DataSource">
    JdbcDriver = org.hsqldb.jdbcDriver
    JdbcUrl = jdbc:hsqldb:mem:blog
    UserName = SA
    Password =
    JtaManaged = false
  </Resource>


is valid

not sure why = was the cause of the issue for you

- Romain


2012/8/9 zeeman <ha...@fastmail.us>

> Yes, I use JPA.
>
> Yes, I need to remove the =.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656765.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

RE: default tomee ds pool

Posted by zeeman <ha...@fastmail.us>.
Yes, I use JPA. 

Yes, I need to remove the =.



--
View this message in context: http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656765.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: default tomee ds pool

Posted by Romain Manni-Bucau <rm...@gmail.com>.
you can use it for all properties if you want

- Romain


2012/8/9 Filip Hanik (mailing lists) <de...@hanik.com>

> And the = sign right?
>
> > -----Original Message-----
> > From: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> > Sent: Thursday, August 09, 2012 11:32 AM
> > To: dev@openejb.apache.org
> > Subject: Re: default tomee ds pool
> >
> > i'd try to remove the quotes ;)
> >
> > - Romain
> >
> >
> > 2012/8/9 zeeman <ha...@fastmail.us>
> >
> > > Thanks Romain. I used this in resources.xml:
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <resources>
> > >         <Resource id="sportingDS" type="javax.sql.DataSource">
> > >           DataSourceCreator             tomcat
> > >           JdbcDriver org.postgresql.Driver
> > >           JdbcUrl jdbc:postgresql://127.0.0.1:5432/sporting
> > >           JtaManaged true
> > >           UserName userme
> > >           Password psw
> > >           MaxActive                     100
> > >           InitialSize                                   2
> > >           MaxIdle                       25
> > >           MinIdle                       2
> > >           suspectTimeout                                60
> > >           maxWait                                               10000
> > >           TimeBetweenEvictionRunsMillis    60000
> > >           minEvictableIdleTimeMillis       60000
> > >           testOnBorrow                                  true
> > >           validationInterval                    30000
> > >           removeAbandoned                               true
> > >           removeAbandonedTimeout                60
> > >           logAbandoned                                  true
> > >           ValidationQuery               SELECT 1
> > >           jmxEnabled     true
> > >
> > >
> > >
> > jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionStat
> > e;org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReportJmx(threshold=1
> > 000,maxQueries=1500);
> > >
> > >
> > >
> > org.apache.tomcat.jdbc.pool.interceptor.StatementCache(prepared=true,cal
> > lable=false,max=100)"
> > >      </Resource>
> > > </resources>
> > >
> > >
> > > I get below error when starting Tomee. I can see all classes listed in
> > > jdbcInterceptors property in tomee/lib/tomcat-jdbc.jar. How come
> > they'er
> > > not
> > > found?
> > >
> > > WARNING: Tomcat-jdbc doesn't support 'MaxOpenPreparedStatements'
> > property,
> > > please configure the StatementCache jdbc interceptor
> > > Aug 9, 2012 1:07:56 PM org.apache.tomee.jdbc.TomEEDataSourceCreator
> > > updateProperties
> > > WARNING: Tomcat-jdbc doesn't support 'PoolPreparedStatements'
> > property,
> > > please configure the StatementCache jdbc interceptor
> > > Aug 9, 2012 1:07:56 PM org.apache.tomcat.jdbc.pool.ConnectionPool init
> > > SEVERE: Unable to inform interceptor of pool start.
> > > java.lang.ClassNotFoundException:
> > > "org.apache.tomcat.jdbc.pool.interceptor.ConnectionState
> > >         at java.net.URLClassLoader$1.run(Unknown Source)
> > >         at java.security.AccessController.doPrivileged(Native Method)
> > >         at java.net.URLClassLoader.findClass(Unknown Source)
> > >         at java.lang.ClassLoader.loadClass(Unknown Source)
> > >         at java.lang.ClassLoader.loadClass(Unknown Source)
> > >         at java.lang.Class.forName0(Native Method)
> > >         at java.lang.Class.forName(Unknown Source)
> > >         at
> > >
> > >
> > org.apache.tomcat.jdbc.pool.PoolProperties$InterceptorDefinition.getInte
> > rceptorClass(PoolProperties.java:944)
> > >         at
> > >
> > org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:468)
> > >         at
> > >
> > org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:14
> > 3)
> > >         at
> > >
> > >
> > org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.
> > java:116)
> > >         at
> > >
> > >
> > org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.j
> > ava:103)
> > >         at
> > >
> > >
> > org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource.<init>(TomE
> > EDataSourceCreator.java:112)
> > >         at
> > >
> > >
> > org.apache.tomee.jdbc.TomEEDataSourceCreator.pool(TomEEDataSourceCreator
> > .java:49)
> > >         at
> > >
> > >
> > org.apache.openejb.resource.jdbc.DataSourceFactory.create(DataSourceFact
> > ory.java:102)
> > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> > Source)
> > >         at java.lang.reflect.Method.invoke(Unknown Source)
> > >         at
> > >
> > >
> > org.apache.xbean.recipe.ReflectionUtil$StaticFactory.create(ReflectionUt
> > il.java:996)
> > >         at
> > >
> > org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:27
> > 6)
> > >         at
> > > org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
> > >         at
> > > org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
> > >         at
> > > org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:49)
> > >         at
> > >
> > >
> > org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.
> > java:1633)
> > >         at
> > >
> > >
> > org.apache.openejb.config.ConfigurationFactory.install(ConfigurationFact
> > ory.java:377)
> > >         at
> > >
> > org.apache.openejb.config.AutoConfig.installResource(AutoConfig.java:181
> > 3)
> > >         at
> > > org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:1475)
> > >         at
> > org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:190)
> > >         at
> > >
> > >
> > org.apache.openejb.config.ConfigurationFactory$Chain.deploy(Configuratio
> > nFactory.java:342)
> > >         at
> > >
> > >
> > org.apache.openejb.config.ConfigurationFactory.configureApplication(Conf
> > igurationFactory.java:825)
> > >         at
> > >
> > >
> > org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebApp
> > Builder.java:781)
> > >         at
> > >
> > >
> > org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAp
> > pBuilder.java:736)
> > >         at
> > >
> > >
> > org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalLis
> > tenerSupport.java:118)
> > >         at
> > >
> > >
> > org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu
> > pport.java:119)
> > >         at
> > >
> > >
> > org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.
> > java:90)
> > >         at
> > >
> > >
> > org.apache.catalina.core.StandardContext.startInternal(StandardContext.j
> > ava:5173)
> > >         at
> > > org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> > >         at
> > >
> > >
> > org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.jav
> > a:1559)
> > >         at
> > >
> > >
> > org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.jav
> > a:1549)
> > >         at java.util.concurrent.FutureTask$Sync.innerRun(Unknown
> > Source)
> > >         at java.util.concurrent.FutureTask.run(Unknown Source)
> > >         at
> > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
> > > Source)
> > >         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> > > Source)
> > >         at java.lang.Thread.run(Unknown Source)
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > > http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-
> > tp4656531p4656756.html
> > > Sent from the OpenEJB Dev mailing list archive at Nabble.com.
> > >
>
>

RE: default tomee ds pool

Posted by "Filip Hanik (mailing lists)" <de...@hanik.com>.
And the = sign right?

> -----Original Message-----
> From: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> Sent: Thursday, August 09, 2012 11:32 AM
> To: dev@openejb.apache.org
> Subject: Re: default tomee ds pool
> 
> i'd try to remove the quotes ;)
> 
> - Romain
> 
> 
> 2012/8/9 zeeman <ha...@fastmail.us>
> 
> > Thanks Romain. I used this in resources.xml:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <resources>
> >         <Resource id="sportingDS" type="javax.sql.DataSource">
> >           DataSourceCreator             tomcat
> >           JdbcDriver org.postgresql.Driver
> >           JdbcUrl jdbc:postgresql://127.0.0.1:5432/sporting
> >           JtaManaged true
> >           UserName userme
> >           Password psw
> >           MaxActive                     100
> >           InitialSize                                   2
> >           MaxIdle                       25
> >           MinIdle                       2
> >           suspectTimeout                                60
> >           maxWait                                               10000
> >           TimeBetweenEvictionRunsMillis    60000
> >           minEvictableIdleTimeMillis       60000
> >           testOnBorrow                                  true
> >           validationInterval                    30000
> >           removeAbandoned                               true
> >           removeAbandonedTimeout                60
> >           logAbandoned                                  true
> >           ValidationQuery               SELECT 1
> >           jmxEnabled     true
> >
> >
> >
> jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionStat
> e;org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReportJmx(threshold=1
> 000,maxQueries=1500);
> >
> >
> >
> org.apache.tomcat.jdbc.pool.interceptor.StatementCache(prepared=true,cal
> lable=false,max=100)"
> >      </Resource>
> > </resources>
> >
> >
> > I get below error when starting Tomee. I can see all classes listed in
> > jdbcInterceptors property in tomee/lib/tomcat-jdbc.jar. How come
> they'er
> > not
> > found?
> >
> > WARNING: Tomcat-jdbc doesn't support 'MaxOpenPreparedStatements'
> property,
> > please configure the StatementCache jdbc interceptor
> > Aug 9, 2012 1:07:56 PM org.apache.tomee.jdbc.TomEEDataSourceCreator
> > updateProperties
> > WARNING: Tomcat-jdbc doesn't support 'PoolPreparedStatements'
> property,
> > please configure the StatementCache jdbc interceptor
> > Aug 9, 2012 1:07:56 PM org.apache.tomcat.jdbc.pool.ConnectionPool init
> > SEVERE: Unable to inform interceptor of pool start.
> > java.lang.ClassNotFoundException:
> > "org.apache.tomcat.jdbc.pool.interceptor.ConnectionState
> >         at java.net.URLClassLoader$1.run(Unknown Source)
> >         at java.security.AccessController.doPrivileged(Native Method)
> >         at java.net.URLClassLoader.findClass(Unknown Source)
> >         at java.lang.ClassLoader.loadClass(Unknown Source)
> >         at java.lang.ClassLoader.loadClass(Unknown Source)
> >         at java.lang.Class.forName0(Native Method)
> >         at java.lang.Class.forName(Unknown Source)
> >         at
> >
> >
> org.apache.tomcat.jdbc.pool.PoolProperties$InterceptorDefinition.getInte
> rceptorClass(PoolProperties.java:944)
> >         at
> >
> org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:468)
> >         at
> >
> org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:14
> 3)
> >         at
> >
> >
> org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.
> java:116)
> >         at
> >
> >
> org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.j
> ava:103)
> >         at
> >
> >
> org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource.<init>(TomE
> EDataSourceCreator.java:112)
> >         at
> >
> >
> org.apache.tomee.jdbc.TomEEDataSourceCreator.pool(TomEEDataSourceCreator
> .java:49)
> >         at
> >
> >
> org.apache.openejb.resource.jdbc.DataSourceFactory.create(DataSourceFact
> ory.java:102)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
> >         at java.lang.reflect.Method.invoke(Unknown Source)
> >         at
> >
> >
> org.apache.xbean.recipe.ReflectionUtil$StaticFactory.create(ReflectionUt
> il.java:996)
> >         at
> >
> org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:27
> 6)
> >         at
> > org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
> >         at
> > org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
> >         at
> > org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:49)
> >         at
> >
> >
> org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.
> java:1633)
> >         at
> >
> >
> org.apache.openejb.config.ConfigurationFactory.install(ConfigurationFact
> ory.java:377)
> >         at
> >
> org.apache.openejb.config.AutoConfig.installResource(AutoConfig.java:181
> 3)
> >         at
> > org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:1475)
> >         at
> org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:190)
> >         at
> >
> >
> org.apache.openejb.config.ConfigurationFactory$Chain.deploy(Configuratio
> nFactory.java:342)
> >         at
> >
> >
> org.apache.openejb.config.ConfigurationFactory.configureApplication(Conf
> igurationFactory.java:825)
> >         at
> >
> >
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebApp
> Builder.java:781)
> >         at
> >
> >
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAp
> pBuilder.java:736)
> >         at
> >
> >
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalLis
> tenerSupport.java:118)
> >         at
> >
> >
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu
> pport.java:119)
> >         at
> >
> >
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.
> java:90)
> >         at
> >
> >
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.j
> ava:5173)
> >         at
> > org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> >         at
> >
> >
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.jav
> a:1559)
> >         at
> >
> >
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.jav
> a:1549)
> >         at java.util.concurrent.FutureTask$Sync.innerRun(Unknown
> Source)
> >         at java.util.concurrent.FutureTask.run(Unknown Source)
> >         at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
> > Source)
> >         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> > Source)
> >         at java.lang.Thread.run(Unknown Source)
> >
> >
> >
> > --
> > View this message in context:
> > http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-
> tp4656531p4656756.html
> > Sent from the OpenEJB Dev mailing list archive at Nabble.com.
> >


Re: default tomee ds pool

Posted by Romain Manni-Bucau <rm...@gmail.com>.
i'd try to remove the quotes ;)

- Romain


2012/8/9 zeeman <ha...@fastmail.us>

> Thanks Romain. I used this in resources.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <resources>
>         <Resource id="sportingDS" type="javax.sql.DataSource">
>           DataSourceCreator             tomcat
>           JdbcDriver org.postgresql.Driver
>           JdbcUrl jdbc:postgresql://127.0.0.1:5432/sporting
>           JtaManaged true
>           UserName userme
>           Password psw
>           MaxActive                     100
>           InitialSize                                   2
>           MaxIdle                       25
>           MinIdle                       2
>           suspectTimeout                                60
>           maxWait                                               10000
>           TimeBetweenEvictionRunsMillis    60000
>           minEvictableIdleTimeMillis       60000
>           testOnBorrow                                  true
>           validationInterval                    30000
>           removeAbandoned                               true
>           removeAbandonedTimeout                60
>           logAbandoned                                  true
>           ValidationQuery               SELECT 1
>           jmxEnabled     true
>
>
> jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReportJmx(threshold=1000,maxQueries=1500);
>
>
> org.apache.tomcat.jdbc.pool.interceptor.StatementCache(prepared=true,callable=false,max=100)"
>      </Resource>
> </resources>
>
>
> I get below error when starting Tomee. I can see all classes listed in
> jdbcInterceptors property in tomee/lib/tomcat-jdbc.jar. How come they'er
> not
> found?
>
> WARNING: Tomcat-jdbc doesn't support 'MaxOpenPreparedStatements' property,
> please configure the StatementCache jdbc interceptor
> Aug 9, 2012 1:07:56 PM org.apache.tomee.jdbc.TomEEDataSourceCreator
> updateProperties
> WARNING: Tomcat-jdbc doesn't support 'PoolPreparedStatements' property,
> please configure the StatementCache jdbc interceptor
> Aug 9, 2012 1:07:56 PM org.apache.tomcat.jdbc.pool.ConnectionPool init
> SEVERE: Unable to inform interceptor of pool start.
> java.lang.ClassNotFoundException:
> "org.apache.tomcat.jdbc.pool.interceptor.ConnectionState
>         at java.net.URLClassLoader$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(Unknown Source)
>         at java.lang.ClassLoader.loadClass(Unknown Source)
>         at java.lang.ClassLoader.loadClass(Unknown Source)
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Unknown Source)
>         at
>
> org.apache.tomcat.jdbc.pool.PoolProperties$InterceptorDefinition.getInterceptorClass(PoolProperties.java:944)
>         at
> org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:468)
>         at
> org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:143)
>         at
>
> org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)
>         at
>
> org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)
>         at
>
> org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource.<init>(TomEEDataSourceCreator.java:112)
>         at
>
> org.apache.tomee.jdbc.TomEEDataSourceCreator.pool(TomEEDataSourceCreator.java:49)
>         at
>
> org.apache.openejb.resource.jdbc.DataSourceFactory.create(DataSourceFactory.java:102)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at
>
> org.apache.xbean.recipe.ReflectionUtil$StaticFactory.create(ReflectionUtil.java:996)
>         at
> org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:276)
>         at
> org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
>         at
> org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
>         at
> org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:49)
>         at
>
> org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:1633)
>         at
>
> org.apache.openejb.config.ConfigurationFactory.install(ConfigurationFactory.java:377)
>         at
> org.apache.openejb.config.AutoConfig.installResource(AutoConfig.java:1813)
>         at
> org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:1475)
>         at org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:190)
>         at
>
> org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:342)
>         at
>
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:825)
>         at
>
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:781)
>         at
>
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:736)
>         at
>
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:118)
>         at
>
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>         at
>
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>         at
>
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5173)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>         at
>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
>         at
>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
>         at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
>         at java.util.concurrent.FutureTask.run(Unknown Source)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
> Source)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
>         at java.lang.Thread.run(Unknown Source)
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656756.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: default tomee ds pool

Posted by zeeman <ha...@fastmail.us>.
Thanks Romain. I used this in resources.xml:

<?xml version="1.0" encoding="UTF-8"?>
<resources>
	<Resource id="sportingDS" type="javax.sql.DataSource">
	  DataSourceCreator		tomcat
	  JdbcDriver org.postgresql.Driver
	  JdbcUrl jdbc:postgresql://127.0.0.1:5432/sporting
	  JtaManaged true
	  UserName userme
	  Password psw
	  MaxActive                     100
	  InitialSize					2
	  MaxIdle                       25
	  MinIdle                       2
	  suspectTimeout				60
	  maxWait 						10000
	  TimeBetweenEvictionRunsMillis    60000
	  minEvictableIdleTimeMillis	   60000
	  testOnBorrow 					true
	  validationInterval			30000
	  removeAbandoned				true
	  removeAbandonedTimeout		60
	  logAbandoned					true
	  ValidationQuery               SELECT 1
	  jmxEnabled     true
	 
jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReportJmx(threshold=1000,maxQueries=1500);
	  		
org.apache.tomcat.jdbc.pool.interceptor.StatementCache(prepared=true,callable=false,max=100)" 
     </Resource>
</resources>


I get below error when starting Tomee. I can see all classes listed in
jdbcInterceptors property in tomee/lib/tomcat-jdbc.jar. How come they'er not
found?

WARNING: Tomcat-jdbc doesn't support 'MaxOpenPreparedStatements' property,
please configure the StatementCache jdbc interceptor
Aug 9, 2012 1:07:56 PM org.apache.tomee.jdbc.TomEEDataSourceCreator
updateProperties
WARNING: Tomcat-jdbc doesn't support 'PoolPreparedStatements' property,
please configure the StatementCache jdbc interceptor
Aug 9, 2012 1:07:56 PM org.apache.tomcat.jdbc.pool.ConnectionPool init
SEVERE: Unable to inform interceptor of pool start.
java.lang.ClassNotFoundException:
"org.apache.tomcat.jdbc.pool.interceptor.ConnectionState
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at
org.apache.tomcat.jdbc.pool.PoolProperties$InterceptorDefinition.getInterceptorClass(PoolProperties.java:944)
	at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:468)
	at
org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:143)
	at
org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)
	at
org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)
	at
org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource.<init>(TomEEDataSourceCreator.java:112)
	at
org.apache.tomee.jdbc.TomEEDataSourceCreator.pool(TomEEDataSourceCreator.java:49)
	at
org.apache.openejb.resource.jdbc.DataSourceFactory.create(DataSourceFactory.java:102)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at
org.apache.xbean.recipe.ReflectionUtil$StaticFactory.create(ReflectionUtil.java:996)
	at
org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:276)
	at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
	at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
	at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:49)
	at
org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:1633)
	at
org.apache.openejb.config.ConfigurationFactory.install(ConfigurationFactory.java:377)
	at
org.apache.openejb.config.AutoConfig.installResource(AutoConfig.java:1813)
	at org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:1475)
	at org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:190)
	at
org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:342)
	at
org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:825)
	at
org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:781)
	at
org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:736)
	at
org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:118)
	at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5173)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)



--
View this message in context: http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656756.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: default tomee ds pool

Posted by Romain Manni-Bucau <rm...@gmail.com>.
the info is here
http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html#Configuring_JDBC_interceptors


you have a sample of StatementCache here:
http://www.tomcatexpert.com/blog/2010/04/19/building-extensions-jdbc-pool

jdbcInterceptors="StatementCache(prepared=true,callable=false,max=50)"



(i didnt find better doc, if anyone know?)



FYI (and for the config) the class is
http://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
(look method setProperties for the config)


- Romain


2012/8/9 zeeman <ha...@fastmail.us>

> I have not used jdbcInterceptors. But whatever is needed to enable
> statement
> cache interceptor to get rid of warnings I posted. Could you point me to an
> example or how should the resoruces.xml should be configured for that?
> Thanks!
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656751.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: default tomee ds pool

Posted by zeeman <ha...@fastmail.us>.
I have not used jdbcInterceptors. But whatever is needed to enable statement
cache interceptor to get rid of warnings I posted. Could you point me to an
example or how should the resoruces.xml should be configured for that?
Thanks!



--
View this message in context: http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656751.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: default tomee ds pool

Posted by Romain Manni-Bucau <rm...@gmail.com>.
oh,

it is a jdbcInterceptors, is it what you are not familiar with?

- Romain


2012/8/9 zeeman <ha...@fastmail.us>

> Hi,
>
> I did not find in the documentation how to add statement cache interceptor.
> Any ideas or links? Thanks!
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656730.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

RE: default tomee ds pool

Posted by zeeman <ha...@fastmail.us>.
Hi,

I did not find in the documentation how to add statement cache interceptor.
Any ideas or links? Thanks!



--
View this message in context: http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656730.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

RE: default tomee ds pool

Posted by "Filip Hanik (mailing lists)" <de...@hanik.com>.
Some documentation on the pool: and one additional thing is that you can
pool XA connections too, something that DBCP didn't support earlier.

http://www.tomcatexpert.com/blog/2010/03/22/understanding-jdbc-pool-performa
nce-improvements

http://www.tomcatexpert.com/blog/2010/04/01/configuring-jdbc-pool-high-concu
rrency

http://www.tomcatexpert.com/blog/2010/04/19/building-extensions-jdbc-pool


> -----Original Message-----
> From: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> Sent: Monday, August 06, 2012 2:06 AM
> To: dev@openejb.apache.org
> Subject: Re: default tomee ds pool
> 
> Hi,
> 
> currently (i mean in the code) it is tomcat-jdbc but not sure we'll keep
> it
> for the release (discussing about it is a bit hard currently since
> that's a
> "holiday time" ;)).
> 
> Since we were using dbcp for years i guess we'll stick on it by default
> for
> some more time but next major release will probably change it.
> 
> Any idea of the difference between both pool? if you can share any
> figures
> please do :)
> 
> - Romain
> 
> 
> 2012/8/4 zeeman <ha...@fastmail.us>
> 
> > I got another build today. I added openejb.jdbc.datasource-creator =
> tomcat
> > to tomee/conf/system.properties
> >
> > and remvoed DBCP and common-pool jar. My app worked. A small batch run
> in
> > background with small number of threads shows a slight edge of Tomcat
> over
> > DBCP. It should make a difference in prod under load.
> >
> > I'm gonna stick with Tomcat pool for now. Will test with BoneCP in a
> real
> > environment later.
> >
> > Thank you for getting this done. This is awesome. Party, women, and
> booze
> > on
> > me :)
> >
> > You should definitely add this as one of Tomee features as other app
> > servers
> > don't allow multiple pool implementations.
> >
> > Which pool is the default? I hope Tomcat one :)
> >
> >
> >
> > --
> > View this message in context:
> > http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-
> tp4656531p4656669.html
> > Sent from the OpenEJB Dev mailing list archive at Nabble.com.
> >


Re: default tomee ds pool

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

currently (i mean in the code) it is tomcat-jdbc but not sure we'll keep it
for the release (discussing about it is a bit hard currently since that's a
"holiday time" ;)).

Since we were using dbcp for years i guess we'll stick on it by default for
some more time but next major release will probably change it.

Any idea of the difference between both pool? if you can share any figures
please do :)

- Romain


2012/8/4 zeeman <ha...@fastmail.us>

> I got another build today. I added openejb.jdbc.datasource-creator = tomcat
> to tomee/conf/system.properties
>
> and remvoed DBCP and common-pool jar. My app worked. A small batch run in
> background with small number of threads shows a slight edge of Tomcat over
> DBCP. It should make a difference in prod under load.
>
> I'm gonna stick with Tomcat pool for now. Will test with BoneCP in a real
> environment later.
>
> Thank you for getting this done. This is awesome. Party, women, and booze
> on
> me :)
>
> You should definitely add this as one of Tomee features as other app
> servers
> don't allow multiple pool implementations.
>
> Which pool is the default? I hope Tomcat one :)
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656669.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: default tomee ds pool

Posted by zeeman <ha...@fastmail.us>.
I got another build today. I added openejb.jdbc.datasource-creator = tomcat
to tomee/conf/system.properties

and remvoed DBCP and common-pool jar. My app worked. A small batch run in
background with small number of threads shows a slight edge of Tomcat over
DBCP. It should make a difference in prod under load. 

I'm gonna stick with Tomcat pool for now. Will test with BoneCP in a real
environment later. 

Thank you for getting this done. This is awesome. Party, women, and booze on
me :)

You should definitely add this as one of Tomee features as other app servers
don't allow multiple pool implementations. 

Which pool is the default? I hope Tomcat one :)



--
View this message in context: http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656669.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: default tomee ds pool

Posted by Romain Manni-Bucau <rm...@gmail.com>.
weird,

just redeployed another snapshot, can you give it another try please?

- Romain


2012/8/3 zeeman <ha...@fastmail.us>

> Hey, like I said I just even tried the old resource.xml without any Tomcat
> pool properties or values. I still get the JMX stacktrace above. So with or
> without datasourcecreator it does not work. To clarify here is what works
> for a previous version of the snapshot (3 weeks old)
>
> <?xml version="1.0" encoding="UTF-8"?>
> <resources>
>         <Resource id="sportivityDS" type="javax.sql.DataSource">
>           JdbcDriver org.postgresql.Driver
>           JdbcUrl jdbc:postgresql://127.0.0.1:5432/db
>           JtaManaged true
>           UserName db
>           Password dbpsw
>           MaxActive                     100
>           InitialSize                                   2
>           MaxIdle                       25
>           MinIdle                       2
>           suspectTimeout                                60
>           maxWait                                               10000
>           TimeBetweenEvictionRunsMillis    60000
>           minEvictableIdleTimeMillis       60000
>           testOnBorrow                                  true
>           validationInterval                    30000
>           removeAbandoned                               true
>           removeAbandonedTimeout                60
>           logAbandoned                                  true
>           abandonWhenPercentageFull             60
>           NumTestsPerEvictionRun        2
>           ValidationQuery               SELECT 1
>      </Resource>
> </resources>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656643.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: default tomee ds pool

Posted by zeeman <ha...@fastmail.us>.
Hey, like I said I just even tried the old resource.xml without any Tomcat
pool properties or values. I still get the JMX stacktrace above. So with or
without datasourcecreator it does not work. To clarify here is what works
for a previous version of the snapshot (3 weeks old)

<?xml version="1.0" encoding="UTF-8"?>
<resources>
	<Resource id="sportivityDS" type="javax.sql.DataSource">
	  JdbcDriver org.postgresql.Driver
	  JdbcUrl jdbc:postgresql://127.0.0.1:5432/db
	  JtaManaged true
	  UserName db
	  Password dbpsw
	  MaxActive                     100
	  InitialSize					2
	  MaxIdle                       25
	  MinIdle                       2
	  suspectTimeout				60
	  maxWait 						10000
	  TimeBetweenEvictionRunsMillis    60000
	  minEvictableIdleTimeMillis	   60000
	  testOnBorrow 					true
	  validationInterval			30000
	  removeAbandoned				true
	  removeAbandonedTimeout		60
	  logAbandoned					true
	  abandonWhenPercentageFull		60
	  NumTestsPerEvictionRun        2
	  ValidationQuery               SELECT 1
     </Resource>
</resources>



--
View this message in context: http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656643.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: default tomee ds pool

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi, datasourcecreator is a property not an attribute of resource tag
Le 2 août 2012 21:42, "zeeman" <ha...@fastmail.us> a écrit :

> I wanted to test it with both Tomcat pool and BoneCP. Below is my config
> for
> Tomcat pool (I did not include any extra jar as it's part of Tomcat).
>
> Here is my resources.xml packaged with my war:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <resources>
>         <Resource id="sportivityDS" type="javax.sql.DataSource"
> dataSourceCreator="tomcat">
>           JdbcDriver org.postgresql.Driver
>           JdbcUrl jdbc:postgresql://127.0.0.1:5432/db
>           JtaManaged true
>           UserName db
>           Password dbpw
>           MaxActive                     100
>           InitialSize                                   2
>           MaxIdle                       25
>           MinIdle                       2
>           suspectTimeout                                60
>           maxWait                                               10000
>           TimeBetweenEvictionRunsMillis    60000
>           minEvictableIdleTimeMillis       60000
>           testOnBorrow                                  true
>           validationInterval                    30000
>           removeAbandoned                               true
>           removeAbandonedTimeout                60
>           logAbandoned                                  true
>           abandonWhenPercentageFull             60
>           NumTestsPerEvictionRun        2
>           ValidationQuery               SELECT 1
>      </Resource>
> </resources>
>
>
> I get below when I start Tomee:
>
> Aug 2, 2012 3:37:54 PM org.apache.tomcat.jdbc.pool.DataSource registerJmx
> SEVERE: Unable to register JDBC pool with JMX
> java.lang.NullPointerException
>         at
> org.apache.tomcat.jdbc.pool.DataSource.registerJmx(DataSource.java:135)
>         at
> org.apache.tomcat.jdbc.pool.DataSource.preRegister(DataSource.java:102)
>         at
>
> org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource.<init>(TomEEDataSourceCreator.java:89)
>         at
>
> org.apache.tomee.jdbc.TomEEDataSourceCreator.pool(TomEEDataSourceCreator.java:42)
>         at
>
> org.apache.openejb.resource.jdbc.DataSourceFactory.create(DataSourceFactory.java:97)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at
>
> org.apache.xbean.recipe.ReflectionUtil$StaticFactory.create(ReflectionUtil.java:996)
>         at
> org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:276)
>         at
> org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
>         at
> org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
>         at
> org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:49)
>         at
>
> org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:1612)
>         at
>
> org.apache.openejb.config.ConfigurationFactory.install(ConfigurationFactory.java:377)
>         at
> org.apache.openejb.config.AutoConfig.installResource(AutoConfig.java:1813)
>         at
> org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:1475)
>         at org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:190)
>         at
>
> org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:342)
>         at
>
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:825)
>         at
>
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:753)
>         at
>
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:708)
>         at
>
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:118)
>         at
>
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>         at
>
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>         at
>
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5173)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>         at
>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
>         at
>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
>         at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
>         at java.util.concurrent.FutureTask.run(Unknown Source)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
> Source)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
>         at java.lang.Thread.run(Unknown Source)
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656637.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: default tomee ds pool

Posted by zeeman <ha...@fastmail.us>.
I wanted to test it with both Tomcat pool and BoneCP. Below is my config for
Tomcat pool (I did not include any extra jar as it's part of Tomcat).

Here is my resources.xml packaged with my war:

<?xml version="1.0" encoding="UTF-8"?>
<resources>
	<Resource id="sportivityDS" type="javax.sql.DataSource"
dataSourceCreator="tomcat">
	  JdbcDriver org.postgresql.Driver
	  JdbcUrl jdbc:postgresql://127.0.0.1:5432/db
	  JtaManaged true
	  UserName db
	  Password dbpw	  
	  MaxActive                     100
	  InitialSize					2
	  MaxIdle                       25
	  MinIdle                       2
	  suspectTimeout				60
	  maxWait 						10000
	  TimeBetweenEvictionRunsMillis    60000
	  minEvictableIdleTimeMillis	   60000
	  testOnBorrow 					true
	  validationInterval			30000
	  removeAbandoned				true
	  removeAbandonedTimeout		60
	  logAbandoned					true
	  abandonWhenPercentageFull		60
	  NumTestsPerEvictionRun        2
	  ValidationQuery               SELECT 1
     </Resource>
</resources>


I get below when I start Tomee:

Aug 2, 2012 3:37:54 PM org.apache.tomcat.jdbc.pool.DataSource registerJmx
SEVERE: Unable to register JDBC pool with JMX
java.lang.NullPointerException
	at org.apache.tomcat.jdbc.pool.DataSource.registerJmx(DataSource.java:135)
	at org.apache.tomcat.jdbc.pool.DataSource.preRegister(DataSource.java:102)
	at
org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource.<init>(TomEEDataSourceCreator.java:89)
	at
org.apache.tomee.jdbc.TomEEDataSourceCreator.pool(TomEEDataSourceCreator.java:42)
	at
org.apache.openejb.resource.jdbc.DataSourceFactory.create(DataSourceFactory.java:97)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at
org.apache.xbean.recipe.ReflectionUtil$StaticFactory.create(ReflectionUtil.java:996)
	at
org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:276)
	at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
	at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
	at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:49)
	at
org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:1612)
	at
org.apache.openejb.config.ConfigurationFactory.install(ConfigurationFactory.java:377)
	at
org.apache.openejb.config.AutoConfig.installResource(AutoConfig.java:1813)
	at org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:1475)
	at org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:190)
	at
org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:342)
	at
org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:825)
	at
org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:753)
	at
org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:708)
	at
org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:118)
	at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5173)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)



--
View this message in context: http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656637.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: default tomee ds pool

Posted by Romain Manni-Bucau <rm...@gmail.com>.
oops just realized i wrote too fast

to switch of pool in the datasource definition use "DataSourceCreator"
property.

to do it globally use "openejb.jdbc.datasource-creator" property.


- Romain


2012/8/2 Romain Manni-Bucau <rm...@gmail.com>

> Jta is here for all (was the goal ;)) since you specify JtaManaged=true
>
> Parameters are the properties of the pool (i added some small conversion
> for obvious cases but the idea is to configure the known pool with its
> known values)
>
> - Romain
> Le 2 août 2012 08:08, "zeeman" <ha...@fastmail.us> a écrit :
>
> Hi,
>>
>> If you help me get it working on here, I can write the doc page for you.
>> Just post the WIKI link with edit permission (like Hibernate page under
>> Tomee documentation section).
>>
>> With Tomcat DS, would JTA persistence units work or do I have to use
>> BoneCP
>> for that?
>>
>> DS properties like (user name, psw, partitionCount, etc...) is it the same
>> format as with DBCP in resources.xml?
>>
>> Thanks for getting this done fast.
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656625.html
>> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>>
>

Re: default tomee ds pool

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Jta is here for all (was the goal ;)) since you specify JtaManaged=true

Parameters are the properties of the pool (i added some small conversion
for obvious cases but the idea is to configure the known pool with its
known values)

- Romain
Le 2 août 2012 08:08, "zeeman" <ha...@fastmail.us> a écrit :

> Hi,
>
> If you help me get it working on here, I can write the doc page for you.
> Just post the WIKI link with edit permission (like Hibernate page under
> Tomee documentation section).
>
> With Tomcat DS, would JTA persistence units work or do I have to use BoneCP
> for that?
>
> DS properties like (user name, psw, partitionCount, etc...) is it the same
> format as with DBCP in resources.xml?
>
> Thanks for getting this done fast.
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656625.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: default tomee ds pool

Posted by zeeman <ha...@fastmail.us>.
Hi,

If you help me get it working on here, I can write the doc page for you.
Just post the WIKI link with edit permission (like Hibernate page under
Tomee documentation section).

With Tomcat DS, would JTA persistence units work or do I have to use BoneCP
for that?

DS properties like (user name, psw, partitionCount, etc...) is it the same
format as with DBCP in resources.xml?

Thanks for getting this done fast.




--
View this message in context: http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656625.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: default tomee ds pool

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

just starting to merge (normally it will be deployed tmr)

you should be able to specify openejb.datasource.pool=bonecp (or dbcp, or
tomcat) in the properties of your datasource

To use bonecp you'll need to add openejb-bonecp + bonecp (+ bonecp deps) in
tomee/lib

Not sure i'll get enough time to write some doc this week about it but
don't hesitate to answer to this thread  if you find any issue.

- Romain


2012/7/28 zeeman <ha...@fastmail.us>

> No need to test on the branch if you're going to merge to trunk next week.
>
> Can you please update this post when you have finished the merge and
> updated
> the docs on how to use the new pool? I'll get a 1.1 snapshot build from
> trunk and test it with my project.
>
> Do I just use BoneCP config params in my resources.xml? A sample config
> file
> would be great. What did you finally decide? BoneCP with Tomee pool? Which
> is one is default? Did you change Tomee.xml for default DSs?
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656556.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: default tomee ds pool

Posted by zeeman <ha...@fastmail.us>.
No need to test on the branch if you're going to merge to trunk next week. 

Can you please update this post when you have finished the merge and updated
the docs on how to use the new pool? I'll get a 1.1 snapshot build from
trunk and test it with my project.

Do I just use BoneCP config params in my resources.xml? A sample config file
would be great. What did you finally decide? BoneCP with Tomee pool? Which
is one is default? Did you change Tomee.xml for default DSs?



--
View this message in context: http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656556.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: default tomee ds pool

Posted by Romain Manni-Bucau <rm...@gmail.com>.
I hope next week (waiting some review).

If you want i can build you the snapshot to give it a try.

- Romain
Le 27 juil. 2012 07:25, "zeeman" <ha...@fastmail.us> a écrit :

> When do you plan to merge the branch to trunk? After you're done, can you
> update the docs on how to use BoneCP/Tomcat pool? Once you have that done,
> I'll be more than happy to test it.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656546.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: default tomee ds pool

Posted by zeeman <ha...@fastmail.us>.
When do you plan to merge the branch to trunk? After you're done, can you
update the docs on how to use BoneCP/Tomcat pool? Once you have that done,
I'll be more than happy to test it.



--
View this message in context: http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656546.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: default tomee ds pool

Posted by Romain Manni-Bucau <rm...@gmail.com>.
currently some integration is done for tomcat jdbc & bonecp so should be
fine (note: in the branch)

regarding dbcp it is not perfect but works fine, look
timeBetweenEvictionRunsMillis
for db restart

- Romain


2012/7/27 zeeman <ha...@fastmail.us>

> As you can see from link I posted and posts on stackoverflow, DBCP does not
> work well when DB is restarted. With its locking nature things get slow.
>
> Tomcat pool or BoneCP, both are good, either one will be fine as default as
> long as it works for JTA and non-JTA persistence units. I thought you said
> Tomcat pool won't support JTA?
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656544.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: default tomee ds pool

Posted by zeeman <ha...@fastmail.us>.
As you can see from link I posted and posts on stackoverflow, DBCP does not
work well when DB is restarted. With its locking nature things get slow.

Tomcat pool or BoneCP, both are good, either one will be fine as default as
long as it works for JTA and non-JTA persistence units. I thought you said
Tomcat pool won't support JTA? 



--
View this message in context: http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656544.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: default tomee ds pool

Posted by Romain Manni-Bucau <rm...@gmail.com>.
I lunched a discussion on it: shoud we use tomcat jdbc by default. Commons
dbcp has a thread validation so i dont get your point, it works fine.

- Romain
Le 26 juil. 2012 21:37, "zeeman" <ha...@fastmail.us> a écrit :

> Hi Romain,
>
> I would default to a pool that supports JTA and non-JTA datasources and
> include its jar. If you plan to support other pools it's reasonable not to
> include their jars by default, ask people who need other pools to include
> the jars with their app. Do you plan to make Tomcat pool or BoneCP one the
> default in Tomee?
>
> Keep in mind DBCP has a nasty issue with abandoned or dropped connection,
> in
> production, if DB is restarted, the app server with DBCP has to be
> restarted
> as well to be able to reconnect to DB. I know BoneCP does not have this
> issue because it's part of their tests.
>
> This might help you a bit
> http://www.jorambarrez.be/blog/2012/04/30/dbcp_vs_c3p0_bonecp/
> Not sure how Tomcat pool compares.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656542.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: default tomee ds pool

Posted by zeeman <ha...@fastmail.us>.
Hi Romain,

I would default to a pool that supports JTA and non-JTA datasources and
include its jar. If you plan to support other pools it's reasonable not to
include their jars by default, ask people who need other pools to include
the jars with their app. Do you plan to make Tomcat pool or BoneCP one the
default in Tomee?

Keep in mind DBCP has a nasty issue with abandoned or dropped connection, in
production, if DB is restarted, the app server with DBCP has to be restarted
as well to be able to reconnect to DB. I know BoneCP does not have this
issue because it's part of their tests.

This might help you a bit
http://www.jorambarrez.be/blog/2012/04/30/dbcp_vs_c3p0_bonecp/
Not sure how Tomcat pool compares.



--
View this message in context: http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656542.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: default tomee ds pool

Posted by Romain Manni-Bucau <rm...@gmail.com>.
they are taken from the default config (for embedded case), i kept them to
warn users it is to activate now (such a change can't be hidden silently
IMO)

adding the interceptor mentionnend in the message will remove it

- Romain


2012/8/8 zeeman <ha...@fastmail.us>

> As you can see in my resources.xml above I don't use PoolPreparedStatements
> or MaxOpenPreparedStatements.
>
> Do they get set somewhere else? Or are you saying I need to do some other
> config for Tomcat-jdbc to get rid of these warnings? Thanks!
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656715.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: default tomee ds pool

Posted by zeeman <ha...@fastmail.us>.
As you can see in my resources.xml above I don't use PoolPreparedStatements
or MaxOpenPreparedStatements. 

Do they get set somewhere else? Or are you saying I need to do some other
config for Tomcat-jdbc to get rid of these warnings? Thanks!



--
View this message in context: http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656715.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: default tomee ds pool

Posted by Romain Manni-Bucau <rm...@gmail.com>.
the first warnings are explicit  i think (that's directly linked to
tomcat-jdbc), no?

the last one is here because you didn't use a D for DataSourceCreator (this
one is case sensitive)

- Romain


2012/8/8 zeeman <ha...@fastmail.us>

> With more testing I see:
>
> Aug 8, 2012 12:58:44 PM org.apache.tomee.jdbc.TomEEDataSourceCreator
> updateProperties
> WARNING: Tomcat-jdbc doesn't support 'MaxOpenPreparedStatements' property,
> please configure the StatementCache jdbc interceptor
> Aug 8, 2012 12:58:44 PM org.apache.tomee.jdbc.TomEEDataSourceCreator
> updateProperties
> WARNING: Tomcat-jdbc doesn't support 'PoolPreparedStatements' property,
> please configure the StatementCache jdbc interceptor
> Aug 8, 2012 12:58:44 PM org.apache.openejb.assembler.classic.Assembler
> logUnusedProperties
> WARNING: Property "dataSourceCreator" not supported by "sportivityDS"
>
> I have posted my DS config above.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656710.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: default tomee ds pool

Posted by zeeman <ha...@fastmail.us>.
With more testing I see:

Aug 8, 2012 12:58:44 PM org.apache.tomee.jdbc.TomEEDataSourceCreator
updateProperties
WARNING: Tomcat-jdbc doesn't support 'MaxOpenPreparedStatements' property,
please configure the StatementCache jdbc interceptor
Aug 8, 2012 12:58:44 PM org.apache.tomee.jdbc.TomEEDataSourceCreator
updateProperties
WARNING: Tomcat-jdbc doesn't support 'PoolPreparedStatements' property,
please configure the StatementCache jdbc interceptor
Aug 8, 2012 12:58:44 PM org.apache.openejb.assembler.classic.Assembler
logUnusedProperties
WARNING: Property "dataSourceCreator" not supported by "sportivityDS"

I have posted my DS config above.



--
View this message in context: http://openejb.979440.n4.nabble.com/default-tomee-ds-pool-tp4656531p4656710.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.