My Life As A Blog

ActiveMQ and SQL Server

leave a comment »

At first, when I tried to use SQL Server (2000) with ActiveMQ there was an error. The error was:

Failed to acquire lock: Line 1: FOR UPDATE clause allowed only for DECLARE CURSOR.

I’m using the jtds jdbc driver. I attached a profiler and the SQL that SQL Server finds offensive is:


I searched through the Nabble forums for ActiveMQ and found the answer here. My jtds config looks like this:

<bean id="jtds-ds" class="net.sourceforge.jtds.jdbcx.JtdsDataSource">
	<property name="serverName" value="localhost"/>
	<property name="portNumber" value="1433"/>
	<property name="databaseName" value="databaseName"/>
	<property name="user" value="userName"/>
	<property name="password" value="password"/>

and my persistence adapter is configured like this:

    <journaledJDBC journalLogFiles="5" dataDirectory="../activemq-data" dataSource="#jtds-ds" useDatabaseLock="false"/>

The useDatabaseLock=False being the important bit.

All of which seems to work.


Written by remark

July 19, 2007 at 4:43 pm

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: