Solved

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

Posted on 2004-09-20
4
1,025 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
  • 2
4 Comments
 
LVL 1

Author Comment

by:Balshe
Comment Utility
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
Comment Utility
What kind is the Database that you use ?
0
 
LVL 6

Accepted Solution

by:
vadim_ti earned 100 total points
Comment Utility
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
Comment Utility
Thanks a lot

0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now