Re: Bug with Multiple Result Sets?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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.

.



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?
    ... 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: 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?
    ... I just got confirmation from DEV that we can reproduce the problem, ... If you can switch to PreparedStatement or ... SELECT VacationHours from HumanResources.Employee where employeeID < 3; ... Vacation hours is 21 ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: [PATCH] sata_nv: fix ADMA ATAPI issues with memory over 4GB (v3)
    ... Morrison, Tom wrote: ... problem I was experiencing was due to the sata_mv driver with 3.75Gig or more of memory)... ... I am on vacation for a week or more ...or I'd tell you today ...
    (Linux-Kernel)