|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I’m working to develop a program that only a commits once after executing a number of stored procedures or rolling back the entire process if there is an exception. Currently I’ve been using dbExpress with TTransactionDesc and nothing is commiting (even when I forced a commit early in the process). I need to know if I’m using this tool incorrectly or if perhaps I should use a different tool all together.
-OS is XP -Delphi 7.0 -Databases are Oracle, MS SQL, and Firebird. Example Code: TD: TTransactionDesc; c_ANSIDatabas : TSQLConnection; sp_ANSIDatabase : TSQLStoredProc; begin TD.TransactionID := 1; TD.IsolationLevel := xilREADCOMMITTED; c_ANSIDatabase.StartTransaction(TD); try //List of the stored procedure names for iCount := 0 to slSqlList.Count - 1 do begin sProcedure := slSqlList[iCount]; slFieldList := slSqlList.Objects[iCount] as TIHStringList; with sp_ANSIDatabase do begin StoredProcName := sProcedure; //Supply Field Data for iSubCount := 0 to Params.Count - 1 do begin sParameter := Params[iSubCount].Name; Params[iSubCount].AsString := slFieldList.Values[sParameter]; if (Params[iSubCount].ParamType = ptOutput) then begin Params[iSubCount].DataType := ftInteger; end;//if (Params[iSubCount].ParamType = ptOutput) then end;//for iSubCount := 0 to Params.Count - 1 do ExecProc; close; end;//with sp_ANSIDatabase do end;//for iCount := 0 to slSqlList.Count - 1 do c_ANSIDatabase.Commit(TD); except on E: Exception do begin c_ANSIDatabase.Rollback(TD); end; end;//try end; |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Delphi Programming > Unable to commit stored procedure changes using dbExpress with TTransactionDesc. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|