?
Solved

TSQLConnection 100 POINT -->"StartTransaction","Rollback","Commit"

Posted on 2004-09-20
4
Medium Priority
?
1,087 Views
Last Modified: 2007-12-19

Hi All
I'm Having this problem with TSQLConnection

i want to know how to do "StartTransaction","Rollback","Commit" it's not working with me i get error as soon as i use this line of code:

  dbIncalls.StartTransaction(TD_INCALLS);

Appreciate your help

Here is the code :

//---------------------------------------------------



type
  TTransIsolationLevel = (xilDIRTYREAD, xilREADCOMMITTED, xilREPEATABLEREAD, xilCUSTOM);
  TTransactionDesc = packed record
     TransactionID    : LongWord;
     GlobalID         : LongWord;
     IsolationLevel   : TTransIsolationLevel;
     CustomIsolation  : LongWord;
  end;

...
...
...
...




private
    { Private declarations }
    dbIncalls:TSQLConnection;
    DBoperdb:TSQLConnection;


...
...
...
...






Procedure un_Process_Thread.Start_Processing;
Var
  TD_INCALLS:TTransactionDesc;
  TD_OPERDB:TTransactionDesc;
Begin
  if not Connect_TO_DB then exit;
  Log_File_Name:=GET_LOG_FILENAME;
  TD_INCALLS.TransactionID  :=  1;
  TD_INCALLS.IsolationLevel := xilREADCOMMITTED;
  dbIncalls.StartTransaction(TD_INCALLS);

  TD_OPERDB.TransactionID  :=  1;
  TD_OPERDB.IsolationLevel := xilREADCOMMITTED;
  DBoperdb.StartTransaction(TD_OPERDB);
  if not Lock_Processed_File(Process_File_Name,Process_File_ID) then
    Begin
      dbIncalls.Rollback;
      DBoperdb.Rollback;
      exit;
    end;

end;
0
Comment
Question by:Balshe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 1

Author Comment

by:Balshe
ID: 12101045
here is the error message i get


 un_Process_Thread_UNIT.pas(323): Incompatible types: 'DBXpress.TTransactionDesc' and 'un_Process_Thread_UNIT.TTransactionDesc'
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 12101272
What kind is the Database that you use ?
0
 
LVL 6

Accepted Solution

by:
vadim_ti earned 400 total points
ID: 12101290
you need to delete type declarations for TTransIsolationLevel  and TTransactionDesc
from your unit

and to include
uses DBXpress
into your unit interface section
0
 
LVL 1

Author Comment

by:Balshe
ID: 12101418
Thanks a lot

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month8 days, 10 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question