IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  Do I need to explicitly close the reference cursor?

    Posted 10/12/12 09:55 PM

    Hi,

    I have an Oracle stored procedure that returns a reference cursor, then, I created a signature adapter service to invoke it.

    Do I need to explicitly close the cursor?

    Thanks in advance


    #Integration-Server-and-ESB
    #Adapters-and-E-Standards
    #webMethods


  • 2.  RE: Do I need to explicitly close the reference cursor?

    Posted 10/17/12 06:43 PM

    Hello westisland,

    We too have an Oracle store proc that returns a reference cursor and we use it in a JDBC adapter service. The adapter service is a storedProcedureWithSignature. We explicitly close the cursor inside the Oracle proc. See the pseudo code below for an example. I hope this helps.

    create or replace PACKAGE MYPACKAGE AS
    type refcur is ref cursor;
    procedure get_clue_list( p_clueCursor out refcur);
    END MYPACKAGE;

    create or replace PACKAGE BODY MYPACKAGE AS
    procedure get_clue_list( p_clueCursor out refcur) AS
    BEGIN
    open p_clueCursor for select field1, field2 from table1;
    return;
    CLOSE p_clueCursor;
    END get_clue_list;
    END MYPACKAGE;


    #webMethods
    #Integration-Server-and-ESB
    #Adapters-and-E-Standards


  • 3.  RE: Do I need to explicitly close the reference cursor?

    Posted 10/17/12 07:34 PM

    Thanks so much Dcova! It works very well.


    #webMethods
    #Adapters-and-E-Standards
    #Integration-Server-and-ESB


  • 4.  RE: Do I need to explicitly close the reference cursor?

    Posted 10/22/12 09:17 PM

    I’m not sure that this actually closes the cursor. From what I know, the return instruction is the last one executed and everything that comes after is skipped.
    You may end up with oracle error “Maximum open cursors exceeded”


    #Adapters-and-E-Standards
    #Integration-Server-and-ESB
    #webMethods