JCO Connection close

Hi  All,
I wanted to know is the connection to close the JCO should be handled in the program or the system will handle since I am using the JCO connection handled by content admin with JCo Pool Configuration.
<b>I am seeing in SAP backend all the sessions are still open.</b>
Thanks,
Rakesh

Valery,
We are having an issue wherein the JCo connections are still listed in AL08 output long after the applications are closed. We do call disconnectIfAlive method after executing the Adapative RFC calls.
Do let me know if there is anyway we can force webdynpro to release connections to the backend or is there any timeout setting in R3 that has to be configured so these connections dont stay open for indefinite time.
Thanks in advance !

Similar Messages

  • JCo Connection Not Proper!

    Hi,
    I am getting this warning message in the web dynpro screen while I am trying to run a particular method;
    Could not create JCOClientConnection for logical System: WD_MODELDATA_DEST - Model: class com.dow.dc.model.Model. Please assure that you have configured the RFC connections and/or logical system name properly for this model!
    Any idea why we get this error?
    I have not received this error while I was running the component first!
    Harika

    Hi
    It seems that this is a custom webdynpro application which when executed causes such problem. This might be due to JCO connection not released back to the pool.
    Please refer to the following threads and that might be helpful.
    Re: JCO Connection close
    How to close a model object connection for Adaptive RFC?
    You might have to call disconnectIfAlive method on your model.
    Regards,
    Anup

  • Unable to close metadata jco connection

    Hi Experts,
    when checking the JCo Connection Pools in Web Dynpro Console, I found that all MetaData JCo are in use and unable to disconnect automatically.
    the following is metadata jco destination setting
    Maximal Pool Size 1
    Maximum Connections 5
    Connection Timeout 60
    Maximum Wait Time 10
    how can i do to close these jco connection?

    Hi Sidney,
    I dont really understand why you want to remove the Jco connections. If you click on the "Remove" button as posted earlier by someone, it will completely remove your Jco configurations and you have to create them again on your own. SO, dont do that.
    If you want to disconnect the Jco connection in webdynpro java, we can do that by using the following piece of code at the end of the  connection process.
    As far as I know, by default the Jco connections gets disconnected after certain time limit. Because, I never had to disconnect the Jco whenever I used one.
    wdContext.currentModelElement().modelObject().modelInstance().disconnectIfAlive()
    Regards,
    Gopal.

  • Close jco connection

    Hi
       Can anyone tell me how to retrieve the existing jco connection and close it. Can we write that code in wdExit.
    Thanks
    Vidyadhar

    Hi,
      Following code can be used
    AAAAModel thisModel =
                        (AAAAModel) WDModelFactory.getModelInstance(
         AAAAModel.class);
                   thisModel.disconnectIfAlive();
    You can call this code's method in wdDoExit()

  • Finding component that does not close JCO connections

    Hi,
    I'm working on a big project with many webdynpro components. My problem is that I seem to be loosing JCO connections. After a while I get JCO connection errors. I just can't find which component is causing this. I checked over and over again.
    Is there a way to check how many JCO connections an application/component has or at least how many open connections a model has?
    I really need to know which component is causing my loss of JCO connections.
    Thanks all!
    Jeschael

    Hi Jeschael,
    Go to System Administration -> System Configuration -> Select Web Dynpro Console -> (Model & backend- You  can check JCo performance by component)  or ( JCo Connection Pools you can check max. calls and active connections for JCos)
    Regards,
    Siva

  • JCO connection pool is exhausted

    hi
    I am using RFC module in my web dynpro application. When the application is used for sometime, the JCO connection will get exhusted. The JCO connection will not release itself. I can't find any method in web dynpro to release the connection manually. How can I solve this problem?

    Hi,
    What is scope of the connection. View properties of MODELDATA and METADATA  destinations.
    You can change the scope of the connection..
    or
    wdContext.current<BAPI INPUT>Element().modelObject().modelInstance().disconnectIfAlive();
    For more ways , give a forum search.. There are a lot of close forum posts.. Gud luc..
    Regards
    Bharathwaj

  • JCO connection error:Couldn't create JCOClientConnection for logical System

    Hi All,
    We are facing a production outage issue.
      We have a Federated Portal Network setup where one of our producer goes down automatically (seems on heavy load).
      On this Producer server we have 3 Web Dynpro applications deployed and default trace is full with JCO connection error   saying Could   not create JCOClientConnection for logical System: CSVMR_WD_MODELDATA_DEST.
    We had issue with max allowed JCO connections so we changed the below mentioned parameters for JCO connection settings in portal:
    u2022     Minimum value of JCo Pool Size in total = 80
    u2022     Minimum value for CPIC_MAX_CONV per SAP Web AS = 320
    u2022     Maximum Number JCo Connections = 160
    Please let us know if we are missing on some settings, any help in this regard is appreciated.
    Regards,
    Priyanka

    Hi,
    As you have already increased the maximum number of connections/pool size but still you are facing this problem. I would suggest you to check the web dynpro application which might not be able to release/disconnect the JCO connection.
    Please check this [Thread|How to close a model object connection for Adaptive RFC?; for more details.
    Regards
    Puneet

  • JCO Connection issue

    Dear All,
    I have created WebDynpro  application by importing track.
    When I deploy the application, it say,
    Deployment completed with warning.
    The warning is "Clusterwide exception: Failed to prepare application".
    Here I guess I need to find out which JCO connection is getting used and to which backend system it is pointing to.
    Could you please tell me where to look for to find out the JCO connection for the application.
    I am not creating new connection for the application, need to use the already created one.
    Thanks and regards,
    Pradnya Ghalsasi

    Hello Pradnya,
    to see what JCO connection you are using
    Go to Contant Admin Role
    click on  Weddynpro Contant there you can see Create Jcos and Maintan Jcos ,
    click on maintain Jcos
    check weather you have WD_METADATA and WD_MODELDATA , if not create one and use it.
    i think you know how to create JCos
    Points if helpful
    Please Close thread if problem solved
    Thanksyou,
    Regards
    Vijai

  • Jco connection :null

    Hi sap gurus
    I am using rfc  connection for executing bapi using some jco connections. but if  the jco are being used for one time it is being executed . but when we deploy application another time . the exception is received as dynamicrfcexecution error jco connection:null.
    when we change the poolsize it is being . the rfc is executed  for only one time.
    please suggest a way to close jco connections . if already present.
    Thanks & Regards
    prasad

    hi , logon mechanism  while creating the JCO Destinations.
    Is  Logon Ticket
    This is code what iam using for rfc access
    Zhr_Emp_List_Input input = new Zhr_Emp_List_Input();
              wdContext.nodeZhr_Emp_List_Input().bind(input); 
         wdContext.nodeZhr_Emp_List_Input().currentZhr_Emp_List_InputElement().setPernr("10" );
              try {
                   wdContext.nodeZhr_Emp_List_Input().currentZhr_Emp_List_InputElement().modelObject().execute();
                   wdContext.nodeOutput().invalidate();
              } catch (WDDynamicRFCExecuteException e) {
                   wdComponentAPI.getMessageManager().reportSuccess(e.toString());
                                  // TODO Auto-generated catch block
                   e.printStackTrace();
              }finally {          
         wdContext.currentZhr_Emp_List_InputElement().modelObject().modelInstance().disconnectIfAlive();  
    for the above code where  Zhr_Emp_List_Input  is the rfc . which will return employee details when we set the Pernr(personal number) to rfc
    the exception is
    com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException: Error connecting using JCO.Client: null
    for only one time the rfc is executing . for the other time if we increase the pool size or change the whole jco references for webdynprojava application . we are able to execute the application

  • Regarding doubt in JCO Connection

    Hai,
         I am doing jco connection in jsp page. its getting executed with out any errors. i have give the detaisl below whci is working fine but where i have to mention the url of "bsp page" ie (http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci1154530,00.html) . Please go through the code below so that by establishing the following connection it should (ie take username and password automatically) straightly go that url mentioned. 
    client = JCO.createClient( "020",  // SAP client "balal",   // userid
    "143bala",  // password "EN",        // language
    "sealerp.sealconsult.com", // host name "00" );      // system number
    <%@ page import="com.sap.mw.jco.*" %>
    <html>
    <head>
    </head>
    <body >
    <form name="form1">
    <%
    //String paramView = request.getParameter("h1")==null?"":request.getParameter("h1");
    //if(paramView.equals("view"))
        JCO.Client client = null;
    JCO.Repository mRepository;
    try {
      // Print the version of the underlying JCO library
    // out.println("\n\nVersion of the JCO-library:\n" +
    \n" +      JCO.getMiddlewareVersion());
      // Create a client connection to a dedicated R/3 system
      client = JCO.createClient( "020",       // SAP client
                         "balal",   // userid
                         "143bala",     // password
                         "EN",        // language
                         "sealerp.sealconsult.com", // host name
                         "00" );      // system number
      // Open the connection
      client.connect();
    mRepository = new JCO.Repository("seal",client);
      // Get the attributes of the connection and print them
      JCO.Attributes attributes = client.getAttributes();
      out.println("Connection attributes:\n" +"----
    \n" + attributes);
      // All done
      out.println("\n\nCongratulations! It worked.");
    catch (Exception ex) {
      out.println("Caught an exception: \n" + ex);
    finally {
        // do not forget to close the client connection
        if (client != null) client.disconnect();
    %>
    </form>
    </body>
    </html>
    Please help me in getting solution.
    Thanks in Advance.
    Thanks & Regards,
    Giridhar.

    Hai,
    sorry i have mentioned wrong bsp url. please check this url.
    http://sealerp.sealconsult.com:8080/sap/bc/bsp/sap/zbsp_primv/project.htm
    the above the bsp page url to be viewed.
    Please help me.
    Thanks in Advance.
    Thanks & Regards,
    Giridhar.

  • JCo Connection / RFC in Pricing Userexit

    Hi Experts,
    Need your help: I have a requirement to make a RFC call in IPC Pricing Userexit.  First I made a simple test java class to make RFC call and run it locally without any problem. then I copy the same code to the Userexit, but it failed on the 1st statment JCO.createClient(.....).  Do I need to add a different JAR file to make JCo Connection work in the Userexit? Any advise or documentation?.
    Thanks, Jin
    Here is the error message:
    Message: document not existing
    --> com.sap.spe.document.rfc.DocIllegalArgumentException: document 49149C3E59925857E10000000A02901D not existing
    at com.sap.spe.document.rfc.DocHandlerAdapter.appendProtocolLine(I[Ljava/lang/Object;)V(DocHandlerAdapter.java:123)
    at com.sap.spe.document.rfc.GetPricingDocumentInfo.handleDocRequest()V(GetPricingDocumentInfo.java:73)
    at com.sap.spe.document.rfc.DocHandlerAdapter.handleRequest()V(DocHandlerAdapter.java:72)
    at com.sap.spe.base.util.jco.HandlerAdapter.handleRequest(Lcom/sap/vmc/RFCContainer/Call;)V(HandlerAdapter.java:103)
    at com.sap.vmc.remserver.RFCDispatcher.privHandleRequest(Lcom/sap/conn/jco/JCoFunction;)V(RFCDispatcher.java:895)
    at com.sap.vmc.remserver.RFCDispatcher.handleRequest(Lcom/sap/conn/jco/JCoFunction;)V(RFCDispatcher.java:673)
    at com.sap.conn.jco.rt.JCoServer.dispatchRequest(Lcom/sap/conn/jco/rt/AbapFunction;)V(JCoServer.java:1605)
    at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcServer.dispatchRequest(Lcom/sap/conn/jco/rt/JCoServer;Ljava/lang/String;)V(MiddlewareJavaRfc.java:2387)
    at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcServer.listen(Lcom/sap/conn/jco/rt/JCoServer;Ljava/lang/String;)V(MiddlewareJavaRfc.java:1694)
    at com.sap.conn.jco.rt.JCoServer.listen()V(JCoServer.java:1375)
    at com.sap.conn.jco.rt.JCoServer.run()V(JCoServer.java:1299)
    at com.sap.vmc.remserver.RfcServer.run()V(RfcServer.java:386)
    at java.lang.Thread.startup(Z)V(Thr
    Thanks, Jin

    Hello Jin,
    IPC does make calls to CRM . To do so it maintains a JCo connection. We got to leverage this connection object and make calls to our RFC. We can use the get_current_connection(); from connection_factory.
    import com.sap.mw.jco.JCO;
    import com.sap.sce.engine.ddb_inst;
    import com.sap.sxe.db.*;
    import com.sap.sxe.db.imp.rfc.*;
    import com.sap.mw.jco.IFunctionTemplate;
    import com.sap.mw.jco.IRepository;
    // For the default connection
    JCO.Client crmJCO = null;
    try{
    / RFC and JCO connection to CRM
         connRFC cRFC = (connRFC)connection_factory.get_current_connection();
         crmJCO = cRFC.getIdleConnection();
    }catch(Exception e){
         log_api.log_write_msg("LOG1", "LOG2",1,
           "Error establishing JCO connection to CRM: "+ e);
    // Now for the BAPI (RFC calls)
    try{
         IRepository repository = JCO.createRepository
                               ("<my BAPI RFC module>", crmJCO);
         IFunctionTemplate ftemplate = repository.getFunctionTemplate
                              ("<my BAPI RFC module>");
         JCO.Function bapiFunc= new JCO.Function(ftemplate);
    // Set your IMPORT, EXPORT, TABLE parameters here
    // Call the JCo function
         crmJCO.execute(bapiFunc);
    // Process the output.
    }catch(Exception e){
         log_api.log_write_msg("LOG3", "LOG4",1,
           "Error calling BAPI "+ e);
    /// DO NOT FORGET TO CLOSE ***+++ MUST DO +++***
    }finally{
         if(crmJCO != null)
              JCO.releaseClient(crmJCO);
    Hence this is using standard connection, no need for any additional jars.
    Easwar Ram
    http://www.parxlns.com

  • Disconnect JCO Connection

    Hi,
    In WebdynPro Application without using Adaptive RFC, we are able to disconnect a connection after few seconds as we using disconnect() method for that.
    But for a WebdynPro Application using Adaptive RFC, we are not able to disconnect a connection as fast as we were able to do in first case.
    We are using following to disconnect:
    wdContext.currentInputElement().modelObject().modelInstance().disconnectIfAlive();
    In SM04 transaction, we observed that the connection(Adaptive RFC) is taking more time to close than it is taking for without Adaptive RFC WD application. The connection still exists even the memory utilized becomes 0 MB.
    Also, when we are not disconnecting in Adaptive RFC WD application, then memory is utilized as long as connection exists. But, when we are disconnecting the connection, the memory utilized is 0 MB though the connection still exists.
    While creating the JCo connection for metadata and modeldata we gave:
    Max pool size : 5
    Max connection: 1000
    Connection Timout (msec.) : 1000
    Maximum Waiting Time (msec.): 5000
    Can anybody suggest how to disconnect the connection to overcome above problem?
    Thanks and Regards,
    Vaibhav

    Hi
    Check this URL
    Actually The Connection will be Terminated when it is inactive for particular time
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/85a483cb-0d01-0010-2990-c5168f01ce8a">Jco Connection Pools</a>
    Regards
    Chandran S

  • JCo Connections in WD Model running out

    Hello,
    we have WD application that uses RFC model.
    During a load test we have observed that the connection
    pools are running out of JCo connections. The result is a an error message in the trace file
    and Http 500 response code to the end user.
    Number of concurrent users: 20
    Max Pool Size: 20
    Max Connections: 20
    Exception:
    [code]aused by: com.sap.mw.jco.JCO$Exception: (106) JCO_ERROR_RESOURCE: Connection pool ME_LP_MODELDATA_TSTWEB1_PT_useSSO is exhausted. The current pool size limit is 20 connections.
         at com.sap.mw.jco.JCO$Pool.getClient(JCO.java:5150)
         at com.sap.mw.jco.JCO$PoolManager.getClient(JCO.java:5849)
         at com.sap.mw.jco.JCO$PoolManager.getClient(JCO.java:5799)
         at com.sap.mw.jco.JCO.getClient(JCO.java:8076)
         at com.sap.tc.webdynpro.serverimpl.core.sl.AbstractJCOClientConnection.getClient(AbstractJCOClientConnection.java:393)
         at com.sap.tc.webdynpro.modelimpl.dynamicrfc.AiiModel.getCurrentlyUsedJcoClient(AiiModel.java:191)[/code]
    Questions:
    Is it necessary to have equal number of Max Connections as
    number of potential concurrent users?
    Or is there a way to manually release not used connections?
    Best Regards, Maik

    Hi,
    It is not necessary to create as many connections as there are concurrent users.
    We have to handle the scope of the connection properly and also close the connections once we complete the task.
    Re: How to close a model object connection for Adaptive RFC?
    Regards
    Bharathwaj

  • Problem with JCo Connection Pool

    Hi,
    I have a problem with using an RFC Model in my WebApplication. So sometimes the access to the function block works, and sometimes it doesn't work. Now I know, that there is a problem with the connection pool. Look at this message:
    com.sap.mw.jco.JCO$Exception: (106) JCO_ERROR_RESOURCE: Connection pool WD_X24_MODELDATA_DEST_CPIC_REKTO_DE_useDefinedUser is exhausted. The current pool size limit (max connections) is 10 connections.
    So it looks like a problem with closing the JCo Connections after using. Do know where the problem is? Because I'm using many other function blocks with no problems.

    Hello,
    You need to increase the pool size via Visual Administrator.
    Server 0 -> Services -> JCO RFC Connections.
    Change the pool size from there. I believe a restart is in order.
    Regards,
    Jan

  • Difference between connection = null and connection.close()

    is it correct
    connection = null means connection object is eligible for garbage collection and does not return to connection pool
    and f or
    connection.close() means the connection object return to the
    connection pool
    is there any other difference between this ....?????

    "connection = null;" is just like any other similar Java statement, it removes that reference to the object. If that was the last reference to the object, then it becomes eligible for finalization and garbage collection, with no guarantee that either will actually occur. However, normal connection pool implementation will have a seperate reference to the connection and if the connection has not been returned, will most likely consider the connection to be "leaked" - allocated but never returned, and unusable.
    connection.close(); is a normal JDBC connection method; it (usually) closes the associated objects and releases the connection; it's not uncommon to explicitly close statements and resultsets instead of depending on connection.close(). A connection pooling implementation that works by extending the Connection class MIGHT change the meaning of close() and instead of actually closing, return it to the pool instead. Personally, I would consider such an implementation to be evil and a blight on good programming practices; changing the action of such standard methods is bound to cause trouble, IMHO. More normally, if you were using connection pooling, you would NOT close the connection, but rather call some special method to return the connection to the pool.

Maybe you are looking for

  • Can fiber channel be used for connect server to a storage in two nodes RAC

    I decided to have an Oracle RAC cluster with only two nodes. The storage I have is a sun 3510FC. Also have five fiber chanal ports. But my each server (Sunfire v240) has got one Ultra160SCSI multimode (SE/LVD) not any fiber chanal ports. I found that

  • Safari crashes after a few seconds every time.

    I'm totally inept with computers, and I know I could update to snow leopard or lion. Every time I open safari, it stays open for about 10 seconds then crashes. Why I try to send the error report to apple it says something like "sorry, try again later

  • I am no longer able to drag and drop my downloaded files

    in yahoo. i, on a daily basis receive about 10 pdf documents and several .dxf files. also autocad .dwg files and jpg files. pretty much any file i have to work with comes to me in my email. i used to be able to select the file, then download it. afte

  • How to create a sophisticated modal interface returning a value?

    Hi, I am trying to create an interface in Java with sophisticated features to allow a user to select a date value. It has to be modal, that is, when the user clicks on a button, the frame opens, the user selects a value and the value must be retrieve

  • No submit button in distributed form - JavaScript help

    I have creted a from in Live Cycle Designer. After distribution submit button is not visible in Acrobat and Reader. I've looked at the form JavaScript and find out this part of code which probably hide submit button in Acrobat 9: showAutoGenSubmitBtn