You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by James Strachan <ja...@gmail.com> on 2006/12/06 16:48:24 UTC

JDBC Master Slave with SQL Server (was Re: [ANN] Apache ActiveMQ 4.1 released!)

On 12/6/06, Jamie McCrindle <ja...@gmail.com> wrote:
> heh, it was the thread where you said "use a different database" :) here's
> the fix message:
>
> http://www.mail-archive.com/activemq-users@geronimo.apache.org/msg03257.html

Thanks :)


> > I don't remember I'm afraid - I do remember a fix going in for pure
> > JDBC Master/Slave for MySQL. I"m not sure if the pure JDBC
> > Master/Slave has been tested yet for SQL Server - fancy trying it out?
> > :)
>
> Happy to! Just wanted to know if I was buying myself some trouble without
> the locking support.

It should be pretty simple to fix. We recently had a similar issue
with MySQL and the fix was just figuring out the right SQL to create
an exclusive lock on the table so we can implement master/slave
properly using JDBC. If you can figure out the right SQL that SQL
Server needs to create an exclusive table lock (and keep it open until
the connection dies) then it should be easy to patch the JDBC adapter

-- 

James
-------
http://radio.weblogs.com/0112098/

Re: JDBC Master Slave with SQL Server (was Re: [ANN] Apache ActiveMQ 4.1 released!)

Posted by Jamie McCrindle <ja...@gmail.com>.
Awesome. Thanks. Will check it out. I assume the JPA guys (hibernate /
openjpa) should have also solved it in a Dialect way so will check out their
code as well.

cheers,
j.

On 12/8/06, James Strachan <ja...@gmail.com> wrote:
>
> On 12/6/06, Jamie McCrindle <ja...@gmail.com> wrote:
> > > If you can figure out the right SQL that SQLServer needs to
> > > create an exclusive table lock (and keep it open until
> > > the connection dies) then it should be easy to patch the JDBC adapter
> >
> > Cool. Will give it a go when some of the noise dies down over here.
>
> Its a while since I've used SQL Server but this is the best reference
> I could find on the locking syntax...
>
> http://msdn2.microsoft.com/en-us/library/ms187373.aspx
>
> maybe something vaguely like this...
>
> SELECT from ActiveMQLocks WITH (TABLOCK, XLOCK)
>
> We could maybe switch to an update statement maybe which might be a
> bit more portable.
>
> --
>
> James
> -------
> http://radio.weblogs.com/0112098/
>

Re: JDBC Master Slave with SQL Server (was Re: [ANN] Apache ActiveMQ 4.1 released!)

Posted by James Strachan <ja...@gmail.com>.
On 12/6/06, Jamie McCrindle <ja...@gmail.com> wrote:
> > If you can figure out the right SQL that SQLServer needs to
> > create an exclusive table lock (and keep it open until
> > the connection dies) then it should be easy to patch the JDBC adapter
>
> Cool. Will give it a go when some of the noise dies down over here.

Its a while since I've used SQL Server but this is the best reference
I could find on the locking syntax...

http://msdn2.microsoft.com/en-us/library/ms187373.aspx

maybe something vaguely like this...

SELECT from ActiveMQLocks WITH (TABLOCK, XLOCK)

We could maybe switch to an update statement maybe which might be a
bit more portable.

-- 

James
-------
http://radio.weblogs.com/0112098/

Re: JDBC Master Slave with SQL Server (was Re: [ANN] Apache ActiveMQ 4.1 released!)

Posted by Jamie McCrindle <ja...@gmail.com>.
> If you can figure out the right SQL that SQLServer needs to
> create an exclusive table lock (and keep it open until
> the connection dies) then it should be easy to patch the JDBC adapter

Cool. Will give it a go when some of the noise dies down over here.

cheers,
j.

On 12/6/06, James Strachan <ja...@gmail.com> wrote:
>
> On 12/6/06, Jamie McCrindle <ja...@gmail.com> wrote:
> > heh, it was the thread where you said "use a different database" :)
> here's
> > the fix message:
> >
> >
> http://www.mail-archive.com/activemq-users@geronimo.apache.org/msg03257.html
>
> Thanks :)
>
>
> > > I don't remember I'm afraid - I do remember a fix going in for pure
> > > JDBC Master/Slave for MySQL. I"m not sure if the pure JDBC
> > > Master/Slave has been tested yet for SQL Server - fancy trying it out?
> > > :)
> >
> > Happy to! Just wanted to know if I was buying myself some trouble
> without
> > the locking support.
>
> It should be pretty simple to fix. We recently had a similar issue
> with MySQL and the fix was just figuring out the right SQL to create
> an exclusive lock on the table so we can implement master/slave
> properly using JDBC. If you can figure out the right SQL that SQL
> Server needs to create an exclusive table lock (and keep it open until
> the connection dies) then it should be easy to patch the JDBC adapter
>
> --
>
> James
> -------
> http://radio.weblogs.com/0112098/
>