Consultor Eletrônico



Kbase P38136: Can a transaction be committed or rolled back inside a store
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   8/21/2003
Status: Unverified

GOAL:

Can a transaction be committed or rolled back inside a stored procedure?

FACT(s) (Environment):

Progress 9.1x

FIX:

No, a transaction may neither be committed nor rolled back inside a stored procedure. This is because stored procedures do not execute either the COMMIT or ROLLBACK statements.

Therefore, it is the developers responsibility to explicitly commit or rollback the transaction after control is returned from executing a stored procedure.

Depending on the business logic involved, developers may choose to commit or abort the transaction immediately after the stored procedure returns control to the calling program.

Executing a ·COMMIT WORK· immediately after a CALL [stored procedure] statement commits the transaction while executing a ·ROLLBACK WORK· statement immediately after a CALL [stored procedure] statement aborts the current transaction.

It is worth noting that in either case, the whole active transaction will be committed or undone and only the updates done inside stored procedure.