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.

 View Only
Expand all | Collapse all

Calling Stored Procedure with Jdbc Adapter Local Connection

  • 1.  Calling Stored Procedure with Jdbc Adapter Local Connection

    Posted Mon October 17, 2005 01:34 PM

    Hello everyone,

    I am using Local Jdbc Connection to SQL database and one of the calls are through stored procedure which is executed successfully but then next batchInsert failes due to
    Unable to invoke adapter service . Unable to connect to resource.The resource is already being used in a parent transaction.

    Here what I am doing:

    Basically I am processing Document with implicit transaction and if exception occurred Stored Procedure called explicitly, but procedure itself has start and end transaction. When I execute it first time it works OK, but in a next loop iteration after error occurred I can not invoke executeBatchInserts with error message above
    Is it because I need to handle it with start/end transaction OR I have to use no transaction connection in this case

    Please advise.
    Any help appreciated

    MainServiceLoop:
    TryDocumentProcessService 
    startLocalTransaction
    executeBatchInserts(many inserts in this block)     
    commitLocalTransaction
    CatchException   
    rollbackLocalTransaction 
    CallStoredProcedureToLogAnException   
    endOfLoop      
    

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


  • 2.  RE: Calling Stored Procedure with Jdbc Adapter Local Connection

    Posted Tue October 18, 2005 04:01 PM

    Hi,
    Use StartTransaction before loop.

    startLocalTransaction
    MainServiceLoop:
    TryDocumentProcessService 
    executeBatchInserts(many inserts in this block)     
    commitLocalTransaction
    CatchException   
    rollbackLocalTransaction 
    CallStoredProcedureToLogAnException   
    endOfLoop      
    

    Try it out. This should work.


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