Hi All,
My requirement is to delete documents from WCC concurrently by using java RIDC API.
I am using java Executer framework to create threads (assume minimum of 10 maximum of 50).
Each thread requires a RIDC connection to delete the documents.
I have written blow method getIntrodocClient() to get Introdoc client Connection object.
But all threads are calling this method getIntrodocClient() to get Connection object, which is leading to java concurrent usage exception.
For avoiding this, i can go with synchronized method or synchronized block concept.
But i want to use RIDC Connection pooling concept. for this i have gone through the oracle official RIDC link
https://docs.oracle.com/cd/E23943_01/doc.1111/e10807/c23_ridc.htm#CSSDK846
I feel in that document they didn't explained about ridc connection pooling fully. no code snipppet provided for connection pooling.
Please Guide/suggest me the best way to implement on connection pooling with WCC using RIDC API.
For IntradocClient IntradocClient
protected static IntradocClient getIntradocClient() throws IdcClientException {
logger.traceEntry("getIntradocClient entry");
IntradocClient intradocClient = null;
Map<String, String> props = null;
int nodeNum = 0;
String server = null;
try {
props = getConfigValues(RIDC + DOT_CFG);
if (props != null) {
do {
if (intradocClient == null) {
if (nodeNum == 0) {
server = SERVER + "default";
} else {
server = SERVER + nodeNum;
}
if (props.containsKey(server)) {
String msg = props.get(PROTOCOL) + COLON + SEPARATOR + SEPARATOR + props.get(server) + COLON
+ props.get(PORT);
logger.info(msg);
intradocClient = (IntradocClient) getIdcClientManager().createClient(msg);
IntradocClientConfig intradocClientConfig = intradocClient.getConfig();
if (props.get(PROTOCOL).equalsIgnoreCase("idcs")) {
String filePath = System.getProperty("user.home") + System.getProperty("file.separator")
+ CFG + System.getProperty("file.separator");
logger.info(filePath);
String keystoreFile = filePath + props.get(KEYSTOREFILE);
intradocClientConfig.setKeystoreFile(keystoreFile);
intradocClientConfig.setKeystorePassword(props.get(KEYSTOREPASSWORD));
intradocClientConfig.setKeystoreAlias(props.get(KEYSTOREALIAS));
intradocClientConfig.setKeystoreAliasPassword(props.get(KEYSTOREALIASPASSWORD));
}
intradocClientConfig.setSocketTimeout(30000);
intradocClientConfig.setConnectionSize(20);
if (pingServer(intradocClient)) {
nodeNum = 6;
logger.info("RIDC connection is initialized with " + msg);
} else {
nodeNum = nodeNum + 1;
intradocClient = null;
String errMsg = "RIDC connection is not initialized with " + msg;
logger.error(errMsg);
gdprErrorLogProc(null, 3001, errMsg, "WCC", "", "", "deleteDoc");
}
} else {
nodeNum = nodeNum + 1;
String errMsg = "Wrong parameters in multinode configuration ridc.cfg file";
logger.error(errMsg);
gdprErrorLogProc(null, 3002, errMsg, "WCC", "", "", "deleteDoc");
}
}
} while (nodeNum <= 5);
} else {
String errMsg = "Valid RIDC connection parameters were not found";
logger.error(errMsg);
gdprErrorLogProc(null, 3003, errMsg, "WCC", "", "", "deleteDoc");
throw new IllegalArgumentException(errMsg);
}
} finally {
logger.traceExit("getIntradocClient exit");
}
return intradocClient;
}
Thanks & Regards,
Ravi.