[ 
https://issues.apache.org/jira/browse/AMQ-3304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13526378#comment-13526378
 ] 

Vincent Cornet commented on AMQ-3304:
-------------------------------------

A short page, like the one dedicated to SQLServer, could be enough.

First, maybe an example of datasource configuration:
{quote}
A dataSource targetting a Sybase ASE database can be configured as follows:
{code}
  <bean id="sybase-ds" class="org.apache.commons.dbcp.BasicDataSource" 
destroy-method="close">
 
    <!-- using jConnect -->
    <property name="driverClassName" value="com.sybase.jdbc4.jdbc.SybDriver"/>
    <property name="url" value="jdbc:sybase:Tds:localhost:4000/activemq"/>
    <!-- using JTDS -->
    <!-- <property name="driverClassName" 
value="net.sourceforge.jtds.jdbc.Driver"/> -->
    <!-- <property name="url" 
value="jdbc:jtds:sybase://localhost:4000/activemq"/> -->

    <property name="username" value="XXX" />
    <property name="password" value="YYY" />
    <!-- and so on with pool config -->
  </bean>
{code}{quote}

Then a paragraph about Sybase-specific behavior:
{quote}
When working on a given Sybase ASE database, each operation (e.g. statement 
execution) is appended to the transaction log. This log grows over time, and 
space has to be freed in order to let the server keep running.
ASE is able to free space up to the oldest opened transaction; that is, if you 
keep a transaction open for too long, the transaction log only grows - until 
the allocated space is full and the database goes down.
So when using the Master-Slave feature of ActiveMQ with a database lock on 
table ACTIVEMQ_LOCK as synchronization monitor (see 
http://activemq.apache.org/jdbc-master-slave.html), you have to be careful. If 
you use only one dataSource, hence only one database, then the lock mechanism 
shall keep a transaction indefinitely open, and while messages are persisted 
the transaction log shall grow until you run out of space.

It is therefore strongly advised to use a dedicated database for this lock: 
just define another dataSource targetting a minimal database holding no data 
(only the ACTIVEMQ_LOCK table) and use it as a lockDataSource in your 
configuration.
Example:
{code}
        <persistenceAdapter>
            <jdbcPersistenceAdapter dataSource="#sybase-ds" 
lockDataSource="#another-sybase-ds"/>
        </persistenceAdapter>
{code}
{quote}

                
> JDBCPersistenceAdapter lockDataSource property (and other settings) should 
> appear on the SQLServer persistence page
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-3304
>                 URL: https://issues.apache.org/jira/browse/AMQ-3304
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 5.5.0
>            Reporter: Arnaud BRAND
>            Priority: Minor
>
> When using the JDBCPersistenceAdapter with SQLServer the use of the 
> lockDataSource property is mandatory, or else the transaction log will fill 
> up (wether the db is in simple or full recovery mode doesn't change 
> anything), and the broker will eventually crash.
> The page http://activemq.apache.org/sqlserver.html should clearly state that 
> the lockDataSource should be used and should point to another database.
> Additionnaly, this page could give another configuration tweak for SQLServer 
> which results in a sensible performance improvement when queues are quite 
> full (>50000 messages in our configuration):
> {code:xml}
> <statements>
>   <statements findNextMessagesStatement="SELECT TOP 5 ID, MSG FROM 
> ACTIVEMQ_MSGS  WHERE CONTAINER=? AND ID > ? ORDER BY ID"/>
> </statements>
> {code} 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to