Contributions
Re: SQL Update statement only working sometimes
I've found a workaround, but I'd still like to know what causes this. The workaround is to use this groovy script: import groovy.sql.Sql def serverName = 'jdbc:jtds:sqlserver://serverName/dbName-CLASS;domain=domainName' serverName = 'jdbc:sqlserver://$IP;databaseName=$DBNAME' def username = '' def password = '' def driver = 'com.microsoft.sqlserver.jdbc.SQLServerDriver' sql = Sql.newInstance( serverName, username, password, driver ) sql.execute( "UPDATE TableName set A = 5 WHERE B = 213" )10 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.7KViews0likes0CommentsSQL 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,10 years agoPlace ReadyAPI QuestionsReadyAPI Questions2KViews0likes2Comments