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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't perform TRANSACTION!

Status
Not open for further replies.

hawran

Programmer
Joined
Dec 17, 2002
Messages
4
Location
CZ
I've got a class (a component), which executes a stored procedure (through a command object). The component "Requires Transaction" and it's called from "Supports Transaction" component . That stored procedure contains some SQL commands (INSERT/UPDATE). When the stored procedure contains no error, every SQL command is performed. When some SQL command is incorrect ísyntax/bad column name/...), the correct commands are performed and incorrect command raises an error ONLY and terminates procedure's executing. Changing from executed commands REMAIN!!!

Well, I expected, that my reaction - SetAbort() - on any exception in my class invoked by any error in the stored procedure (actually, in any SQL batch) causes ROLLBACK!

PS: A connection object is opened inside the component which "Requires Transaction".
PS: WIN 2000 Professional (SP2), SQL Server Desktop Engine 2000, DTC is running, tested on ONE machine (fault?)
PPS: Both Rollback or Commit (after Begin, of course) works...

Thanks a lot!
hawran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top