RhettS
11 years agoNew Contributor
SQL Update statement only working sometimes
I've got a test case with these steps:
1. JDBC SQL request like: UPDATE DBName..TableName set var1 = '9' WHERE var2 = '12345' AND var3 = '5'
2. JDBC SQL request like: SELECT * FROM DBName..TableName WHERE WHERE var2 = '12345' AND var3 = '5'
2.a) assert that var1 in the results from step 2 was equal to 9
Around 10% of the time, the test fails.
I've tried doing the whole thing from MS SQL Server Management Studio, and it works fine as you'd expect. I've also used a query in MS SQL Server Management Studio to confirm that, alas, around 10% of the times I run that test case the UPDATE statement does not have any effect on the server.
I am using a JDBC connection with the com.microsoft.sqlserver.jdbc.SQLServerDriver driver, if that helps.
So my questions is: What could possibly be causing this?
Thanks,
1. JDBC SQL request like: UPDATE DBName..TableName set var1 = '9' WHERE var2 = '12345' AND var3 = '5'
2. JDBC SQL request like: SELECT * FROM DBName..TableName WHERE WHERE var2 = '12345' AND var3 = '5'
2.a) assert that var1 in the results from step 2 was equal to 9
Around 10% of the time, the test fails.
I've tried doing the whole thing from MS SQL Server Management Studio, and it works fine as you'd expect. I've also used a query in MS SQL Server Management Studio to confirm that, alas, around 10% of the times I run that test case the UPDATE statement does not have any effect on the server.
I am using a JDBC connection with the com.microsoft.sqlserver.jdbc.SQLServerDriver driver, if that helps.
So my questions is: What could possibly be causing this?
Thanks,