Controlling Transaction commit when using sqlProcedure
Please suggest me if the below usecase can be achieved :
When using sqlProcedure application will not be passivation safe, so we need to do the SqlProcedure and Commit call in same request.
1. SqlProcedure AddPersonProc adds a person in Person table and returns the Success , Warning and Failure status with list of Message and Rule in case of Warning and Failure.
2. Now based on the different status, I want to do following :
a) Success - Commit . ( Pretty Easy )
b) Error - RollBack ( Pretty Easy ) .. and show the Errors.
c) Warning - Show Warnings with AcceptAndContinue and Cancel button ( This i have done ).
On Cancel - Roll Back ( Pretty Easy )
On AcceptAndContinue - Commit the new record to the database.
Problem faced : For warning ... 1) if I do the rollBack... then my VO looses all data.
2) If I don't do rollback and simply call AM commit then there is no data committed in case AM passivate ( point highlighted in bold )
3) If I don't do rollBack and again calls SqlProcedure AddPersonProc and then commit then two records inserted in case AM doesn't passivate .
Please suggest how do I implement this with available SqlProcedure AddPersonProc .
Thanks,
Rajdeep