Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 14th, 2005, 07:24 PM
Moki Moki is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 1 Moki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Unable to commit stored procedure changes using dbExpress with TTransactionDesc.

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;

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > Unable to commit stored procedure changes using dbExpress with TTransactionDesc.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT