Hi JB - that worked, but I had to add this to the property-placeholder:
placeholder-prefix="[[" placeholder-suffix="]]"
The defaults of "${" and "}" cause the maven-bundle-plugin to get into a
very bad state - spewing lots of warning and eventually running out of heap
space.
Thanks for your help!
Marc
On Thu, Dec 3, 2015 at 2:43 PM, Jean-Baptiste Onofré <[email protected]>
wrote:
> You should not use ext with cfg file.
>
> Instead use:
>
> <cm:property-placeholder id="property-placeholder"
> persistent-id="DefaultDataSource">
> <cm:default-properties>
> <cm:property name="foo" value="bar"/>
> </cm:default-properties>
> </cm:property-placeholder>
>
> Regards
> JB
>
> On 12/03/2015 06:22 PM, Marc Durand wrote:
>
>> Thanks JB. I am currently using:
>>
>> <ext:property-placeholder>
>> <ext:location>file:etc/DefaultDataSource.cfg</ext:location>
>> </ext:property-placeholder>
>>
>> How would I go about using blueprint:cm?
>>
>> Thanks,
>>
>> Marc
>>
>>
>> On Thu, Dec 3, 2015 at 11:33 AM, Jean-Baptiste Onofré <[email protected]
>> <mailto:[email protected]>> wrote:
>>
>> You can use blueprint:cm to use ConfigAdmin in the blueprint
>> datasource.
>>
>> Regards
>> JB
>>
>> On 12/03/2015 04:20 PM, Marc Durand wrote:
>>
>> Hi JB,
>>
>> I believe it is the connection pool. I was creating the
>> datasource with
>> blueprint like so:
>>
>> <bean id="DefaultDataSource"
>>
>> class="com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource">
>> <property name="serverName" value="${Default.server}" />
>> <property name="user" value="${Default.username}" />
>> <property name="password" value="${Default.password}" />
>> </bean>
>> <bean id="DefaultDataSourcePool"
>> class="org.apache.commons.dbcp.datasources.SharedPoolDataSource"
>> destroy-method="close">
>> <property name="connectionPoolDataSource"
>> ref="DefaultDataSource" />
>> <property name="maxActive"
>> value="${Default.pool.maxActive}" />
>> <property name="maxIdle" value="${Default.pool.maxIdle}"
>> />
>> <property name="maxWait" value="${Default.pool.maxWait}"
>> />
>> <property name="validationQuery"
>> value="${Default.pool.validationQuery}" />
>> </bean>
>> <service ref="DefaultDataSourcePool"
>> interface="javax.sql.DataSource">
>> <service-properties>
>> <entry key="osgi.jndi.service.name
>> <http://osgi.jndi.service.name>
>> <http://osgi.jndi.service.name>" value="DefaultDataSource" />
>> </service-properties>
>> </service>
>>
>> I now know that it is incorrect because that configuration is
>> for the
>> Apache DBCP. So I changed it to this which works:
>>
>> <bean id="DefaultDataSource"
>>
>> class="com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource">
>> <property name="serverName" value="${Default.server}" />
>> <property name="user" value="${Default.username}" />
>> <property name="password" value="${Default.password}" />
>> </bean>
>> <service ref="DefaultDataSource" interface="javax.sql.DataSource">
>> <service-properties>
>> <entry key="osgi.jndi.service.name
>> <http://osgi.jndi.service.name> <http://osgi.jndi.service.name>"
>> value="DefaultDataSource"/>
>> <entry key="aries.xa.name <http://aries.xa.name>
>> <http://aries.xa.name>" value="DefaultDataSource" />
>> <entry key="datasource.name <http://datasource.name>
>> <http://datasource.name>"
>> value="DefaultDataSource"/>
>> <entry key="aries.xa.poolMaxSize" value="200" />
>> </service-properties>
>> </service>
>>
>> But, I don't want to hardcode the pool size in the blueprint.xml
>> file.
>> I would like to use config admin and do something like this:
>>
>> <bean id="DefaultDataSource"
>>
>> class="com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource">
>> <property name="serverName" value="${Default.server}" />
>> <property name="user" value="${Default.username}" />
>> <property name="password" value="${Default.password}" />
>> </bean>
>> <service ref="DefaultDataSource" interface="javax.sql.DataSource">
>> <service-properties>
>> <entry key="osgi.jndi.service.name
>> <http://osgi.jndi.service.name> <http://osgi.jndi.service.name>"
>> value="DefaultDataSource"/>
>> <entry key="aries.xa.name <http://aries.xa.name>
>> <http://aries.xa.name>" value="DefaultDataSource" />
>> <entry key="datasource.name <http://datasource.name>
>> <http://datasource.name>"
>> value="DefaultDataSource"/>
>> <entry key="aries.xa.poolMaxSize"
>> value="${Default.aries.xa.poolMaxSize}" />
>> </service-properties>
>> </service>
>>
>>
>> The Maven bundle plugin complains about it:
>>
>> 003: No translation found for macro:
>> Default.aries.xa.connectionMaxWaitMilliseconds, in
>> -----------------
>> Warnings
>> 000: Unused Private-Package instructions, no such package(s) on
>> the
>> class path: [!*]
>> 001: No translation found for macro:
>> Default.aries.xa.exceptionSorter,
>> in -----------------
>> Warnings
>> 000: Unused Private-Package instructions, no such package(s) on
>> the
>> class path: [!*]
>>
>>
>> And with 4 similar data sources, the build takes over 30 seconds
>> and
>> eventually runs out of memory. I noticed that those macros (like
>> ${Default.aries.xa.poolMaxSize}) then get included in the
>> MANIFEST.MF
>> file, which is not what I want:
>>
>> Export-Service: javax.sql.DataSource;osgi.jndi.service.name
>> <http://osgi.jndi.service.name>
>> <http://osgi.jndi.service.name>=DefaultDataS
>> ource;aries.xa.name <http://aries.xa.name>
>> <http://aries.xa.name>=DefaultDataSource;datasource.name
>> <http://datasource.name>
>> <http://datasource.name>=DefaultDataSource
>>
>>
>> ;aries.xa.exceptionSorter=${Default.aries.xa.exceptionSorter};aries.xa.
>>
>>
>> connectionMadIdleMinutes=${Default.aries.xa.connectionMadIdleMinutes};a
>>
>>
>> ries.xa.connectionMaxWaitMilliseconds=${Default.aries.xa.connectionMaxW
>>
>>
>> aitMilliseconds};aries.xa.pooling=${Default.aries.xa.pooling};aries.xa.
>>
>>
>> poolMaxSize=${Default.aries.xa.poolMaxSize};aries.xa.poolMinSize=${Defa
>>
>>
>> ult.aries.xa.poolMinSize};aries.xa.validateOnMatch=${Default.aries.xa.v
>>
>>
>> alidateOnMatch};aries.xa.backgroundValidation=${Default.aries.xa.backgr
>>
>>
>> oundValidation};aries.xa.backgroundValidationMilliseconds=${Default.ari
>> es.xa.backgroundValidationMilliseconds}
>>
>>
>> So, is it possible to configure a data source in blueprint when
>> using
>> the pax-jdbc-pool-aries where the configuration would be in the
>> etc
>> directory?
>>
>> Thanks in advance,
>> Marc
>>
>>
>> On Thu, Dec 3, 2015 at 12:36 AM, Jean-Baptiste Onofré
>> <[email protected] <mailto:[email protected]>
>> <mailto:[email protected] <mailto:[email protected]>>> wrote:
>>
>> Hi Marc,
>>
>> do you think it's the transaction pool ? Maybe it's the
>> connection
>> pool ?
>>
>> For transaction, you can override the default value by
>> creating
>> etc/org.apache.aries.transaction.cfg file (or using the
>> config:*
>> commands).
>>
>> The default values provided by the feature are:
>>
>> aries.transaction.recoverable = true
>> aries.transaction.timeout = 600
>> aries.transaction.howl.logFileDir =
>> ${karaf.data}/txlog
>> aries.transaction.howl.maxLogFiles = 2
>> aries.transaction.howl.maxBlocksPerFile = 512
>> aries.transaction.howl.bufferSize = 4
>>
>> For the datasource, it depends how you created the
>> datasource.
>>
>> Did you use the jdbc:* commands to create the datasource ?
>>
>> Regards
>> JB
>>
>>
>> On 12/03/2015 03:57 AM, Marc Durand wrote:
>>
>> Hello - I am using Karaf 3.0.5 and noticed that I
>> cannot run
>> more than 10
>> simultaneous database queries because the pool runs out
>> of
>> connections. I
>> found the limit to be set to 10 in
>> org.apache.aries.transaction.jdbc-2.1.0.jar
>>
>>
>> (org.apache.aries.transaction.jdbc.internal.ConnectionManagerFactory)
>> where
>> I found this line: "private int poolMaxSize = 10;" and
>> also in
>> ManagedDataSourceFactory class:
>> "cm.setPoolMaxSize(getInt("aries.xa.poolMaxSize", 10));"
>>
>> My question is, how can I increase this value?
>>
>> Thanks,
>> Marc
>>
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>>
>> http://karaf.922171.n3.nabble.com/Aries-pool-max-size-tp4044047.html
>> Sent from the Karaf - User mailing list archive at
>> Nabble.com.
>>
>>
>> --
>> Jean-Baptiste Onofré
>> [email protected] <mailto:[email protected]>
>> <mailto:[email protected] <mailto:[email protected]>>
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>>
>>
>> --
>> Jean-Baptiste Onofré
>> [email protected] <mailto:[email protected]>
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>>
>>
> --
> Jean-Baptiste Onofré
> [email protected]
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>