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
  • 1.  Unclosed WmDB Connections

    Posted Tue June 05, 2007 04:07 AM

    Hello,

    We have a WmDB operation service: pub.db:connect, pub.db:insert, pub.db:close. But if there is any exception between the connect and close, there will be a unclosed connection. So when we checked in DB server, we could find a connection from the webMethods server with the “AWAITING COMMAND”.

    We aslo tried to invoke the pub.db:close in the “Catch” sequence,but it dosen’t work. Any one can help? Thanks.

    Here are some informations of our environment:
    IS: 6.1
    WmDB: 6.1
    DB: SQL Server 2000
    Driver: JTDS 1.2


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


  • 2.  RE: Unclosed WmDB Connections

    Posted Tue June 05, 2007 08:34 AM

    Hello,
    we use a lot WmDB, and this is the right way to go:

    -map (to create a document that will hold the db connection object, let’s call it localVars)
    -try…catch block
    –try
    —pub.db:open (and map the output connection into localVars)

    —pub.db:close (referring the connection insite localVars)
    –catch

    —pub.db:close (referring the connection insite localVars)
    -map (drop localVars)

    The reason to use localVars is inside [url]wmusers.com

    Regards,
    Sandro


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


  • 3.  RE: Unclosed WmDB Connections

    Posted Tue June 05, 2007 09:14 AM

    Thanks Sandro,

    It works fine as your way. Thanks a lot.


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


  • 4.  RE: Unclosed WmDB Connections

    Posted Thu June 07, 2007 05:48 PM

    If you don’t want to use a global service variable to store the dbConnection, you can get the connection from the lastError/pipeline variable in the catch block.


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


  • 5.  RE: Unclosed WmDB Connections

    Posted Fri June 08, 2007 03:14 AM

    Hi ylo,

    When I tried to use the connection under the lastError/pipeline, I got the error “java.lang.ClassCastException”. It seems the connection object was unavailable after the exception. So are there some tips? Would you please share me a sample about this? Thanks a lot.


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


  • 6.  RE: Unclosed WmDB Connections

    Posted Fri June 08, 2007 10:37 AM

    I really dislike the ylo approach (just a personal feeling); I’d rather explicit declaration without playing with pipeline variables in the catch branch.

    Sandro


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