Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rollback for databases that don't support transactions

Status
Not open for further replies.

Griffyn

Programmer
Jul 11, 2002
1,077
0
36
AU
Hi all,

This may be uncommon, but I'm working with a database (Powerflex) who's ODBC driver doesn't support transactions. So if an error occurs during a set of UPDATE, INSERT and DELETE SQL commands, I'm left in limbo.

Originally, I'd hand write an SQL statement that was the reverse of the one I just executed, store it in a TStringList, catch the exception, and then play out those reverse statements. Crude, but it worked. And it doubled the amount of SQL I'd have to write, plus encouraged sync errors between the statement pairs.

So, embarking on a new project with lots of SQL throughout, I thought I'd be smart about it and write TAutoRollback, which executes the original SQL statement I give it, but before it does parses through it and automagically generates the reverse statement. It's a fair bit of crunching but I'm getting there. And it's only now 60% done that I think that perhaps all this work has been done before by smarter people.

Does anyone know of a rollback component that can automatically reverse SQL commands?
 
Hi Aaron,

I'm actually using the Connx powerflex ODBC (8.9) driver. I've had a look at the documentation for their latest version (10.5) and unforunately it still doesn't support transactions for powerflex. ([URL unfurl="true"]http://www.connx.com/products/connx/Connx%2010.5%20UserGuide/connxcdd32c/powerflex.htm[/url]). The datasheet for powerflex also fails to mention 'transaction' anywhere. Their ODBC driver supports a few other types of DB systems, and it does support transactions for those.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top