Re: Bug with Multiple Result Sets?

Tech-Archive recommends: Fix windows errors by optimizing your registry



Wes,

I just got confirmation from DEV that we can reproduce the problem, but only when using Statement.Execute. If you can switch to PreparedStatement or
CallableStatement, you should get the proper results for the update counts.

We have fixed this issue in SP1 of our 2005 JDBC driver (currently targeted for somewhere around June or July). If you need to get this fixed sooner, go
ahead and open a case with us and we can see about filing a request for a fix. As always, since it is a known bug, the case will be non-decrement.

Evan
--------------------
Thread-Topic: Bug with Multiple Result Sets?
thread-index: AcZG68ZADsnto+BvRAyRO9+m8Q4j4w==
X-WBNR-Posting-Host: 209.78.47.227
From: =?Utf-8?B?V2VzIENsYXJr?= <WesClark@xxxxxxxxxxxxxxxxxxxxxxxxx>
References: <BFF86425-775F-4123-AE58-3C84FE25425C@xxxxxxxxxxxxx> <43DD5D6F.3060806@xxxxxxx> <461F7166-63ED-4C52-85CE-
C08A52F2E576@xxxxxxxxxxxxx> <On#bgN3JGHA.2992@xxxxxxxxxxxxxxxxxxxx> <v0UZ$NCLGHA.1240@xxxxxxxxxxxxxxxxxxxxx> <12CE9C6C-9E6F-
4ACA-9463-FE9799075C52@xxxxxxxxxxxxx> <09HCtnjNGHA.3504@xxxxxxxxxxxxxxxxxxxxx> <ED7C8EFF-FDFF-46C4-8280-16162AB415F7
@microsoft.com> <t9X0cPZOGHA.3052@xxxxxxxxxxxxxxxxxxxxx> <pAZoYouRGHA.4824@xxxxxxxxxxxxxxxxxxxxx>
Subject: Re: Bug with Multiple Result Sets?
Date: Mon, 13 Mar 2006 14:16:28 -0800

Thanks for the update. I'll look into why we are using Statement.execute()
instead of CallableStatement.execute().
"Evan T. Basalik (MSFT)" wrote:

Wes,

I did some more playing around and it looks like I can only repro the problem if I use Statement.Execute. If I use PreparedStatement or
CallableStatement,
the update counts are picked up correctly.

We are still researching...

Evan
--------------------
X-Tomcat-ID: 563255050
References: <BFF86425-775F-4123-AE58-3C84FE25425C@xxxxxxxxxxxxx> <43DD5D6F.3060806@xxxxxxx> <461F7166-63ED-4C52-85CE-
C08A52F2E576@xxxxxxxxxxxxx> <On#bgN3JGHA.2992@xxxxxxxxxxxxxxxxxxxx> <v0UZ$NCLGHA.1240@xxxxxxxxxxxxxxxxxxxxx> <12CE9C6C-
9E6F-
4ACA-9463-FE9799075C52@xxxxxxxxxxxxx> <09HCtnjNGHA.3504@xxxxxxxxxxxxxxxxxxxxx> <ED7C8EFF-FDFF-46C4-8280-16162AB415F7
@microsoft.com>
From: evanba@xxxxxxxxxxxxxxxxxxxx (Evan T. Basalik (MSFT))
Organization: Microsoft
Date: Fri, 24 Feb 2006 22:44:21 GMT
Subject: Re: Bug with Multiple Result Sets?

Wes,

With your code and stored proc, I am able to reproduce the results. Let me do some more testing and I will let you know what I find.

Evan

--------------------
Thread-Topic: Bug with Multiple Result Sets?
Subject: Re: Bug with Multiple Result Sets?
Date: Mon, 20 Feb 2006 16:56:29 -0800

Here are some very interesting results. I created a stored procedure that
returned result set interspersed with update counts:
CREATE PROCEDURE testProcReturns
AS
BEGIN
SELECT VacationHours from HumanResources.Employee where employeeID < 3;
update HumanResources.Employee set VacationHours = VacationHours + 1 where
employeeID < 3;
SELECT VacationHours from HumanResources.Employee where employeeID < 3;
update HumanResources.Employee set VacationHours = VacationHours - 1 where
employeeID < 3;
SELECT VacationHours from HumanResources.Employee where employeeID < 3;
END;

When I ran the procedure using all four drivers, all except the new driver
correctly returned the update counts:

Class being loaded com.microsoft.sqlserver.jdbc.SQLServerDriver
URL being used:
jdbc:sqlserver://localhost:2005;selectMethod=direct;databaseName=AdventureWorks;user=sa;password=123
Vacation hours is 21
Vacation hours is 42
Vacation hours is 22
Vacation hours is 43
Vacation hours is 21
Vacation hours is 42
Class being loaded com.microsoft.jdbc.sqlserver.SQLServerDriver
URL being used:
jdbc:microsoft:sqlserver://localhost:2005;selectMethod=direct;databaseName=AdventureWorks;user=sa;password=123;
Vacation hours is 21
Vacation hours is 42
Update count is: 2
Vacation hours is 22
Vacation hours is 43
Update count is: 2
Vacation hours is 21
Vacation hours is 42
Class being loaded com.newatlanta.jturbo.driver.Driver
URL being used:
jdbc:JTurbo://localhost:2005/AdventureWorks/user=sa/password=123
Vacation hours is 21
Vacation hours is 42
Update count is: 2
Vacation hours is 22
Vacation hours is 43
Update count is: 2
Vacation hours is 21
Vacation hours is 42
Class being loaded net.sourceforge.jtds.jdbc.Driver
URL being used:
jdbc:jtds:sqlserver://localhost:2005/AdventureWorks;user=sa;password=123
Vacation hours is 21
Vacation hours is 42
Update count is: 2
Vacation hours is 22
Vacation hours is 43
Update count is: 2
Vacation hours is 21
Vacation hours is 42

I am not clear what is going on here, but these results strongly suggest the
new driver is not behaving correctly.



--

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.




--

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.





--

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.

.



Relevant Pages

  • Re: Bug with Multiple Result Sets?
    ... SELECT VacationHours from HumanResources.Employee where employeeID < 3; ... When I ran the procedure using all four drivers, ... Vacation hours is 21 ... Use of included script samples are subject to the terms specified at ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Bug with Multiple Result Sets?
    ... SELECT VacationHours from HumanResources.Employee where employeeID < 3; ... When I ran the procedure using all four drivers, ... Vacation hours is 21 ... Use of included script samples are subject to the terms specified at ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Bug with Multiple Result Sets?
    ... I have refiled the original bug with the additional information. ... SELECT VacationHours from HumanResources.Employee where employeeID < 3; ... When I ran the procedure using all four drivers, ... Vacation hours is 21 ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Bug with Multiple Result Sets?
    ... With your code and stored proc, I am able to reproduce the results. ... SELECT VacationHours from HumanResources.Employee where employeeID < 3; ... When I ran the procedure using all four drivers, ... Vacation hours is 21 ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: SLUB: Increasing partial pages
    ... I was on vacation then and it seems that I was unable to ... reproduce the oopses. ... Can I get some backtraces or other information ...
    (Linux-Kernel)