Gen

Expand all | Collapse all

C# Database Commits / Rollbacks

Jump to Best Answer
  • 1.  C# Database Commits / Rollbacks

    Posted 03-15-2014 11:43 AM

    I have a Gen generated C# server that is reading and writing to both DB2 and Oracle database tables via ODBC connections.  My question is ..... When and how do the COMMITs or ROLLBACKs happen when exit states are set?  If a normal, successful exit occurs, how or where does the COMMIT happen?  If you set an exit state with rollback, how / where does that happen?  Are there seperate COMMITs / ROLLBACKs done for each database connection?   In COBOL, I can see all of this coding in the batch manager or dialog manager generated programs but I don't see it anywhere in the C# programs....... Thanks  

    (btw .. I am not a .NET trained programmer so maybe I might just not understand how things work in .NET.  But that's supposed to be the beauty of Gen, right? )



  • 2.  RE: C# Database Commits / Rollbacks
    Best Answer

    Broadcom Employee
    Posted 03-16-2014 08:26 PM
    S_Pickett:

    I have a Gen generated C# server that is reading and writing to both DB2 and Oracle database tables via ODBC connections.  My question is ..... When and how do the COMMITs or ROLLBACKs happen when exit states are set?  If a normal, successful exit occurs, how or where does the COMMIT happen?  If you set an exit state with rollback, how / where does that happen?  Are there seperate COMMITs / ROLLBACKs done for each database connection?   In COBOL, I can see all of this coding in the batch manager or dialog manager generated programs but I don't see it anywhere in the C# programs....... Thanks  

    (btw .. I am not a .NET trained programmer so maybe I might just not understand how things work in .NET.  But that's supposed to be the beauty of Gen, right? )

     

    Hi Stacey,

    As you probably know in general a commit will only take place at the end of a Gen Procedure Step unless there is any external action block code performing intermittent commit processing. Setting an “EXIT STATE with rollback” or having an EAB issuing a rollback will cause a rollback instead.

    Gen .NET Server transactions are generated as COM+ applications that run under the control of Component Services. The transaction management is performed in the Gen .NET runtime using the Microsoft COM+ Transaction Manager which should also handle any 2-phased commit aspect across multiple databases which are supported for .NET servers. There is a section in the “Distributed Processing - .NET Server User Guide" on "Multiple Database Support" and here is the link to the online Gen 8.5 version:

    https://support.ca.com/cadocs/0/CA%20Gen%208%205-ENU/Bookshelf_Files/HTML/DistributedProcessing.NETServerUserGuide/965928.html

    Hope this helps

    Regards,

     



  • 3.  RE: C# Database Commits / Rollbacks

    Posted 03-18-2014 09:42 AM

    Thanks Lynn.  That's what I needed to know.

    Regards,

    Stacy Pickett