Hi,
I'm calling a third party stored procedure in Oracle from VB that is not rolling back.
Code first (I'm simplifying):
Connection string:
String sqlstr = "SERVER=x.x.x.x;Database=db;uid=sa;pwd=admin;Connect Timeout=60; Min Pool Size=5; Max Pool Size=100;";
The call (I've just forced a rollback immediately after the execute to test it):
Dim Oraclecon As New OracleConnection(_OracleConnection)
Dim sqlCon As New SqlConnection(_SQLConnection)
Dim oTrans As OracleTransaction = Nothing
Oraclecon.Open()
oTrans = Oraclecon.BeginTransaction()
Dim myCMD As New OracleCommand()
myCMD.Connection = Oraclecon
myCMD.Transaction = oTrans
myCMD.CommandText = "CREATE_USER"
myCMD.CommandType = CommandType.StoredProcedure
myCMD.Parameters.Add(New OracleParameter("username", OracleType.VarChar)).Value = UserName
myCMD.Parameters.Add(New OracleParameter("passwd", OracleType.VarChar)).Value = Password
myCMD.Parameters.Add(New OracleParameter("speed", OracleType.VarChar)).Value = Speed
myCMD.Parameters.Add(New OracleParameter("monthly_quota", OracleType.VarChar)).Value = Quota
myCMD.Parameters.Add(New OracleParameter("type", OracleType.VarChar)).Value = "H"
Dim oparam As OracleParameter
oparam = New OracleParameter("success_flag", OracleType.VarChar)
oparam.Size = 1
oparam.Direction = ParameterDirection.Output
Dim oparam2 As OracleParameter
oparam2 = New OracleParameter("err_msg", OracleType.VarChar)
oparam2.Direction = ParameterDirection.Output
oparam2.Size = 100
myCMD.Parameters.Add(oparam)
myCMD.Parameters.Add(oparam2)
Dim RowId As OracleString
myCMD.ExecuteOracleNonQuery(RowId)
oTrans.Rollback()
I can't give the details of the stored procedure but it does a commit and rollback inside it.
Either way, it is doing an insert, and that immediate rollback does not rollback the insert.
Any ideas?