on 01-11-2006 11:48 AM
Hi all,
I have a public DC in which I have a generic method which creates a connection and returns the JCO.Client object to the other DCs which use this DC. The code for this is given below :-
public com.sap.mw.jco.JCO.Client getClient( )
{
//@@begin getClient()
IWDJCOClientConnection connection =
WDSystemLandscape.getJCOClientConnection(
"PROD_MODELDATA_RFC",
"");
connection.update(
connection.getMaxPoolSize(),
connection.getMaxNumberOfConnections(),
connection.getMaxWaitTime(),
connection.getConnectionTimeOut(),
connection.getMessageServer(),
connection.getSystemName(),
connection.getLogonGroup(),
connection.getClientName(),
WDUserDefinitionType.DEFINED_USER,
"userid",
"pwd",
connection.getSNCMode(),
connection.getSNCSecurityLevel(),
connection.getSNCPartnerName(),
connection.getSNCName(),
connection.getSNCLibraryPath(),
connection.getLanguage());
client = connection.getClient();
return client;
//@@end
}
Note that "PROD_METADATA_RFC" is a JCO created in content admin.I am doing this, as I will get the user id and password dynamically.
Now the code of the application which calls this DC :-
JCO.Client client = wdThis.wdGetInterfaceManagerInterface().getClient();
if (client != null) {
GetOrgDetModal model =
(GetOrgDetModal) WDModelFactory.getModelInstance(
GetOrgDetModal.class,
WDModelScopeType.TASK_SCOPE);
model.setJcoClient(client);
wdContext.nodeCmpCtx_List_of_organizations().bind(input);
try {
wdContext
.currentCmpCtx_List_of_organizationsElement()
.modelObject()
.execute();
JCO.releaseClient(client);
model.disconnectIfAlive();
wdComponentAPI.getMessageManager().reportSuccess(
"Connection released");
} catch (WDDynamicRFCExecuteException e) {
wdComponentAPI.getMessageManager().reportException(
e.getMessage(),
false);
}
}else{
wdComponentAPI.getMessageManager().reportException("problem in get client - null", true);
}
But the connections are not getting closed. I am getting max connections expiry error very frequently.
Please let me know what is the problem in the code.
Regards,
Narahari
Message was edited by: Narahari Vedula
Message was edited by: Narahari Vedula
Hi Narahari,
In your earlier post also VS has posted this reply to you
/people/sap.user72/blog/2005/01/08/adaptive-rfc-models-in-web-dynprosome-pointers
have you checked this one already ?.
Have you also get the message "Connection released" ??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Baskaran,
I have checked this weblog earlier. But I cannot implement most of the points mentioned in this as all the applicaitons are already developed and changing them now to follow them will be really very difficult.
This public DC is being used by all applications in our project. I have created a seperate test DC which uses this DC and called my methods in the generic DC and tested it. In the test DC -Yes, I am getting the "Connection released" message. But when all other applications start calling this method, it is not closing the connections.
I have a doubt if I need to provide a seperate method which has :-
connection.release();
and should call that method in all the other applications to ensure that the connection is also closed and not just the client.
Note:- I am creating the connection object in my generic DC and just returing the Client object. But still the connection object remains.
Please help me in finding what is exactly wrong??
Regards,
Narahari
Hi Baskaran,
In all the applications which use my public DC, we have removed the "modelInstance_defaultLogicalSystem" (which is a property under "Model Settings" of the Model. But we still are having "modelInstance_defaultScope" as APPLICATION_SCOPE.
i.e.,
Model Settings :-
modelInstance_defaultLogicalSystem <b><blank></b>
modelInstance_defaultScope <b>APPLICATION_SCOPE</b>
requiresCodeGeneration true
Also under "Model Class Settings" we have :-
abapName ZY_GET_LIST_OF_ORGANIZATIONS
defaultScope <b>APPLICATION_SCOPE</b>
isExecutable true
isLocal false
rfcPartType input
I am not sure what each one exactly means.
Will override the scope which I am setting at run time while connecting ??
Regards,
Narahari
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.