Re: Using MARS with JDBC Driver
- From: "Angel Saenz-Badillos[MS]" <angelsa@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 20 Jan 2006 10:04:35 -0800
Thank you for the info on query plans and server side cursors I will
definitelly have to do some investigation here.
--
Angel Saenz-Badillos [MS] DataWorks
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging: http://weblogs.asp.net/angelsb/
"Jerry Brenner" <JerryBrenner@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D5F5177E-A3C3-44A2-9923-BBE1B7923D3A@xxxxxxxxxxxxxxxx
>> > In the cases that we saw (and sent to Microsoft), one of the
>> > transactions
>> > was blocked on the SELECT by another transaction that was blocked on
>> > the
>> > UPDATE. It seemed incredible that a transaction that had just updated
>> > a
>> > row
>> > was blocked trying to read that same row.
>>
>> I assume this is where the MARS discussion came up, the only likely
>> explanation here is that the driver you were using at the time supported
>> fake MARS by using a separate connection under the covers for the second
>> select. Since the new connection does not run under the same transaction
>> context as the first connection you would effectively lock yourself in
>> what
>> appears to be the same connection.
>>
>
> This is not correct. We were using the jdbc driver that came with SQL
> Server 2000. The deadlock was between 2 concurrent instances of the same
> transaction, each using only 1 connection, not a self deadlock. The
> deadlock
> was due to the fact that SQL Server still acquires locks on indexes.
>
>> > With SQL Server 2000, we have to do an UPDATE instead of a SELECT FOR
>> > UPDATE.
>> This should have been similar to executing a resultSet with
>> java.sql.ResultSet.TYPE_FORWARD_ONLY,
>> java.sql.ResultSet.CONCUR_UPDATABLE.
>> You mentioned something about server side cursor not scaling the way you
>> expected, could you elaborate on this? We are actually looking at Oracle
>> compatibility options for future releases of the JDBC driver and one of
>> the
>> options on the table was to convert FOR UPDATE queries in client side
>> statements into server cursor based forward only updatable resultsets
>> under
>> the covers.
>>
>
>
> The problem with SelectMethod=cursor was that we were getting some
> terrible
> query plans. I tried adding the primary key to some of the indexes,
> because
> unique indexes were required for cursors when I worked at Sybase. This
> fixed
> some of the problems, but there were a ton of problems. I undid that
> change
> and switched to SelectMethod=direct and the problems with the bad query
> plans
> went away.
>
>
.
- References:
- Re: Using MARS with JDBC Driver
- From: Angel Saenz-Badillos[MS]
- Re: Using MARS with JDBC Driver
- From: Angel Saenz-Badillos[MS]
- Re: Using MARS with JDBC Driver
- From: Jerry Brenner
- Re: Using MARS with JDBC Driver
- From: Angel Saenz-Badillos[MS]
- Re: Using MARS with JDBC Driver
- From: Angel Saenz-Badillos[MS]
- Re: Using MARS with JDBC Driver
- Prev by Date: Re: SQL Server 2005 JDBC Driver. Old jars in classpath?
- Next by Date: Re: New JDBC Driver 1/19/06 & SSL ?
- Previous by thread: Re: Using MARS with JDBC Driver
- Next by thread: Re: SQL Server 2005 JDBC Driver. Old jars in classpath?
- Index(es):
Relevant Pages
|