A dataSource targetting a Sybase ASE database can be configured as follows:

Sybase Datasource
  <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 -->

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 a synchronization monitor (see, 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 targeting a minimal database holding no data (only the ACTIVEMQ_LOCK table) and use it as a lockDataSource in your configuration.


  <jdbcPersistenceAdapter dataSource="#sybase-ds" lockDataSource="#another-sybase-ds"/>
© 2004-2011 The Apache Software Foundation.
Apache ActiveMQ, ActiveMQ, Apache, the Apache feather logo, and the Apache ActiveMQ project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram