DBX components & SQL Server transactions
Posted: Fri 05 Aug 2011 13:56
I am having a problem with Delphi 2007 & DBExpress. I have installed the DevArt SQL Server driver and am using that to make my database connection.
It appears as though explicit transactions are not working. In my program I make a call to TSQLConnection.BeginTransaction. If I place a breakpoint at this line in the program and use SQL Server Manager to check to active transactions for the database I find zero. I then step through the BeginTransaction call. I would expect SQL Server Manager to now show an active transaction for the database. But it does not. It still show zero active transactions. In fact, no transactions appear on the database until I execute the first DML statement via TSQLQuery. At this time an implicit transaction appears. Not an explicit transaction as I would expect.
Am I doing something wrong? Are there problems with the DBX components in Delphi 2007? Or do I just not understand the way SQL Server is supposed to work?
I really need explicit transactions if my application is to work the way is should.
It appears as though explicit transactions are not working. In my program I make a call to TSQLConnection.BeginTransaction. If I place a breakpoint at this line in the program and use SQL Server Manager to check to active transactions for the database I find zero. I then step through the BeginTransaction call. I would expect SQL Server Manager to now show an active transaction for the database. But it does not. It still show zero active transactions. In fact, no transactions appear on the database until I execute the first DML statement via TSQLQuery. At this time an implicit transaction appears. Not an explicit transaction as I would expect.
Am I doing something wrong? Are there problems with the DBX components in Delphi 2007? Or do I just not understand the way SQL Server is supposed to work?
I really need explicit transactions if my application is to work the way is should.