I'm dealing with an odd issue, no one in my team was able to help me.
I've created a web service to delete content from a table. When I run this function from SOAP Center, everything is fine, values are deleted.
As soon as I call this function from my application, it is not working and nothing happen. I don't have any error and I tried to put return value to catch any error and nothing.
Can someone explain the difference in the execution if the issue come from this ?
Function in the WS
Public Function DELETE_VALUES() As Integer
Dim db2Transaction As MsDb2Transaction
Dim db2Command As MsDb2Command
Dim oracleCommand As OracleCommand
Using db2Connection As New MsDb2Connection(myConnectionString)
Try
db2Connection.Open()
db2Transaction = db2Connection.BeginTransaction
Dim sSqlDelete As String = String.Empty
sSqlDelete += "DELETE FROM TABLE_DB2 "
sSqlDelete += "WHERE ACTIVE = 'Y' "
db2Command.Transaction = db2Transaction
db2Command.ExecuteNonQuery()
' Commit needed on our DB2 DB
db2Transaction.Commit()
Catch ex As MsDb2Exception
db2Connection.Close()
Return 8
Finally
db2Connection.Close()
End Try
End Using
Using oracleConnection As New OracleConnection(myConnectionStringOracle)
Try
oracleConnection.Open()
Dim sSqlDelete As String = String.Empty
sSqlDelete += "DELETE FROM TABLE_ORACLE "
sSqlDelete += "WHERE ACTIVE = 'Y' "
oracleCommand.ExecuteNonQuery()
' Commit is automatic on Oracle
Catch ex As MsDb2Exception
oracleConnection.Close()
Return 9
Finally
oracleConnection.Close()
End Try
End Using
Return 0
End Function
Function from my application
Public Function ValuesTreatment() As Integer
WS_Functions.DELETE_VALUES()
' The rest of this function will add recent values
End Function
question from:
https://stackoverflow.com/questions/66065107/vb-net-sql-query-for-deletion-not-executed 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…