cancel
Showing results for 
Search instead for 
Did you mean: 

JCO Connection Pool Problem

Former Member
0 Kudos

Hello Sir/Madame,

We use connection pools successfully in J2EE application for log on to the SAP Server with generic user as shown "http://help.sap.com/saphelp_nw04/helpdata/en/bc/eedf3d0eb8af5ee10000000a114084/frameset.htm". Through this application, we connect to the backend system and create Purchase Requisition via using 'BAPI_PR_CREATE' function. Program test was successful. The past days, we started to users training about 30 persons, when users pressed save button at the same time, each of them successfully create PR, BAPI return message "xxx number Purchase Requisition was created", but for a problem emerges: BAPI returning in the message, user A creates requisition with number xxx, user B creates requisition with number yyy. But when we look at SAP, xxx requisition has been created by user B and yyy requisition has been created by user A.

When we tried this scenario with 4-5 persons, its ok, we donu2019t have a problem. Each person create Purchase Requisition with own user name. So while many users have built (about over 20 persons) connections with connection pool are involved.

Do you have a suggestion for this situation?

Accepted Solutions (0)

Answers (1)

Answers (1)

siarhei_pisarenka3
Active Contributor
0 Kudos

Hello,

Please provide the source code where you are obtaining pool and invoking the BAPI.

BR, Sergei

Former Member
0 Kudos

Hello Sergei,

I guess i have a problem on read SSO cookie, while many person want to save or edit process, i've read their password value from ticket like that

****

String ticket ="";

Cookie[] all_Cookies = request.getCookies ();

for (int i=0; i<all_Cookies.length; i++) {

if (all_Cookies<i>.getName().equals("MYSAPSSO2")) {

ticket = all_Cookies<i>.getValue ();

break;

}

}

****

How can i read correct SSO Cookie value when many person were SAP Process via SSO in my application?

Regards,

Former Member
0 Kudos

Hi,

The below code should work...

static final String POOL_NAME = "Pool";
   JCO.Client mConnection;
   public Connect2() {
     try {
       JCO.Pool pool = JCO.getClientPoolManager().getPool(POOL_NAME);
       if (pool == null) {
         OrderedProperties logonProperties = OrderedProperties.load("/logon.properties");
         JCO.addClientPool(POOL_NAME, // pool name
                           5, // maximum number of  connections         
                         logonProperties); // properties
       }
       mConnection = JCO.getClient(POOL_NAME);
    }
    catch (Exception ex) {
      ex.printStackTrace();
    }
    finally {
      JCO.releaseClient(mConnection);
    }
  }

Regards,

Muthukumar