You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by chu_man_fu <ce...@bytron.com> on 2009/07/02 15:20:21 UTC
Using Oracle for persistence - DB sessions not dying
I am using oracle as my persistence store. ActiveMQ is running via
activemq-web-console-5.2.0.war which is embedded into JBoss 4.2.2GA on a
linux box.
The config is thus:
<persistenceAdapter>
<journaledJDBC dataSource="#oracle-ds" useDatabaseLock="false">
<statements>
<statements tablePrefix="MSG_SER_ACTMQ_" />
</statements>
</journaledJDBC>
</persistenceAdapter>
<bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName"
value="oracle.jdbc.driver.OracleDriver"/>
<property name="url" value="jdbc:oracle:oci:@MY_DB"/>
<property name="username" value="scott"/>
<property name="password" value="tiger"/>
<property name="maxActive" value="200"/>
<property name="poolPreparedStatements" value="true"/>
</bean>
Which works.
The only problem is my DBA. I left the JBoss running last night with no
message producers running.
When I got into work this morning he wanted to know why there is a java
process on my linux box with has taken 100+ oracle sessions. Once I stopped
JBoss (and the broker) all the sessions died and my DBA was happy again.
Why isn't ActiveMQ killing the sessions once they are used?
Am I missing a config setting?
Thanks
Chris
--
View this message in context: http://www.nabble.com/Using-Oracle-for-persistence---DB-sessions-not-dying-tp24306601p24306601.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Using Oracle for persistence - DB sessions not dying
Posted by chu_man_fu <ce...@bytron.com>.
None of the options which I can see tell the connections to die after usage.
When the server starts up I have 20 sessions open. Within 1 hour this is
risen to 26.
Gary Tully wrote:
>
> <property name="maxActive" value="200"/> maps to setMaxActive in the
> BasicDataSource, so just add the properties that you need.
>
> 2009/7/3 chu_man_fu <ce...@bytron.com>
>
>>
>> How can I configure this class via the XML config?
>> That link is the API for the Java class. I have no control over how this
>> is
>> used, the persistance is done internal to ActiveMQ...isn't it?
>>
>>
>> Gary Tully wrote:
>> >
>> > You got to configure the jdbc connection pool to close idle connections
>> if
>> > you want this behavior. Check out the api reference
>> >
>> http://commons.apache.org/dbcp/apidocs/org/apache/commons/dbcp/BasicDataSource.html
>> >
>> > -
>> > http://blog.garytully.com
>> >
>> > Open Source Integration
>> > http://fusesource.com
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Using-Oracle-for-persistence---DB-sessions-not-dying-tp24306601p24319799.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
>
>
> --
> http://blog.garytully.com
>
> Open Source Integration
> http://fusesource.com
>
>
--
View this message in context: http://www.nabble.com/Using-Oracle-for-persistence---DB-sessions-not-dying-tp24306601p24321691.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Using Oracle for persistence - DB sessions not dying
Posted by Gary Tully <ga...@gmail.com>.
<property name="maxActive" value="200"/> maps to setMaxActive in the
BasicDataSource, so just add the properties that you need.
2009/7/3 chu_man_fu <ce...@bytron.com>
>
> How can I configure this class via the XML config?
> That link is the API for the Java class. I have no control over how this is
> used, the persistance is done internal to ActiveMQ...isn't it?
>
>
> Gary Tully wrote:
> >
> > You got to configure the jdbc connection pool to close idle connections
> if
> > you want this behavior. Check out the api reference
> >
> http://commons.apache.org/dbcp/apidocs/org/apache/commons/dbcp/BasicDataSource.html
> >
> > -
> > http://blog.garytully.com
> >
> > Open Source Integration
> > http://fusesource.com
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Using-Oracle-for-persistence---DB-sessions-not-dying-tp24306601p24319799.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>
--
http://blog.garytully.com
Open Source Integration
http://fusesource.com
Re: Using Oracle for persistence - DB sessions not dying
Posted by chu_man_fu <ce...@bytron.com>.
How can I configure this class via the XML config?
That link is the API for the Java class. I have no control over how this is
used, the persistance is done internal to ActiveMQ...isn't it?
Gary Tully wrote:
>
> You got to configure the jdbc connection pool to close idle connections if
> you want this behavior. Check out the api reference
> http://commons.apache.org/dbcp/apidocs/org/apache/commons/dbcp/BasicDataSource.html
>
> -
> http://blog.garytully.com
>
> Open Source Integration
> http://fusesource.com
>
>
--
View this message in context: http://www.nabble.com/Using-Oracle-for-persistence---DB-sessions-not-dying-tp24306601p24319799.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Using Oracle for persistence - DB sessions not dying
Posted by Gary Tully <ga...@gmail.com>.
You got to configure the jdbc connection pool to close idle connections if
you want this behavior. Check out the api reference
http://commons.apache.org/dbcp/apidocs/org/apache/commons/dbcp/BasicDataSource.html
2009/7/2 chu_man_fu <ce...@bytron.com>
>
> I am using oracle as my persistence store. ActiveMQ is running via
> activemq-web-console-5.2.0.war which is embedded into JBoss 4.2.2GA on a
> linux box.
>
> The config is thus:
>
> <persistenceAdapter>
> <journaledJDBC dataSource="#oracle-ds" useDatabaseLock="false">
> <statements>
> <statements tablePrefix="MSG_SER_ACTMQ_" />
> </statements>
> </journaledJDBC>
> </persistenceAdapter>
>
> <bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource"
> destroy-method="close">
> <property name="driverClassName"
> value="oracle.jdbc.driver.OracleDriver"/>
> <property name="url" value="jdbc:oracle:oci:@MY_DB"/>
> <property name="username" value="scott"/>
> <property name="password" value="tiger"/>
> <property name="maxActive" value="200"/>
> <property name="poolPreparedStatements" value="true"/>
> </bean>
>
> Which works.
> The only problem is my DBA. I left the JBoss running last night with no
> message producers running.
> When I got into work this morning he wanted to know why there is a java
> process on my linux box with has taken 100+ oracle sessions. Once I stopped
> JBoss (and the broker) all the sessions died and my DBA was happy again.
>
> Why isn't ActiveMQ killing the sessions once they are used?
> Am I missing a config setting?
>
> Thanks
> Chris
> --
> View this message in context:
> http://www.nabble.com/Using-Oracle-for-persistence---DB-sessions-not-dying-tp24306601p24306601.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>
--
http://blog.garytully.com
Open Source Integration
http://fusesource.com