We are running a batch process to import files automatically into Documentum. Even though only 1 session is created in Dctm, there are multiple db processes created and the processes are not being released after each db transaction. So after reaching Max processes we are getting '
ORA-00020: maximum number of processes (300) exceeded' error.
We need to import around 10,000 files in the batch process.
Please see the code below and let me know if we can make any changes:
public static File fileName(File file, IDfSession session, String filePath) throws Exception{
try {
String[] totalFiles = file.list();
String absolutePath = "";
if (file.isDirectory())
{
}
else
{
for (int i = 0; i < totalFiles.length; i++)
{
fileName(new File(file, totalFiles[i]), session, filePath);
}
document = (IDfDocument)session.newObject("dm_document");
document.setObjectName(objectName);
IDfClientX dfclientx = new DfClientX();
IDfFormatRecognizer formatRec = dfclientx.getFormatRecognizer(session, finalFileName, "");
IDfList formatList = formatRec.getSuggestedFileFormats();
for(int i = 0 ; i < formatList.getCount() ; i++)
{
fileFormat = formatList.getString(i)
System.out.println("File format: "+fileFormat);
}
document.setContentType(fileFormat);
document.setFileEx(absolutePath, fileFormat, 0, null );
document.save();