In my DFC 6.5SP1 application this is how I am making and releasing a session
Code:
public boolean folderExists(String folderName, String path) {
IDfSessionManager smgr = null;
IDfSession session = null;
try {
smgr = DFCUtil.newInstance().getSessionManager();
session = DFCUtil.newInstance().getDocbaseSession(smgr);
IDfFolder folder = session.getFolderByPath(path);
if(folder != null) {
folderExists = true;
}
} catch (DfException dfe) {
DfLogger.error(this, "Path : "+path, null, dfe);
throw new RuntimeException(dfe);
} finally {
if(smgr != null && session != null) {
smgr.release(session);
}
}
return folderExists;
}
Code:
public IDfSessionManager getSessionManager() {
IDfClientX clientx =null;
IDfClient client=null;
IDfSessionManager smgr = null;
try {
clientx=new DfClientX();
client=clientx.getLocalClient();
smgr=client.newSessionManager();
}catch(Exception e) {
throw new RuntimeException(e);
}
return smgr;
}
Code:
public IDfSession getDocbaseSession(IDfSessionManager smgr){
RegistryPasswordUtils putils = new RegistryPasswordUtils();
IDfLoginInfo logininfo=null;
IDfClientX clientx =null;
String lsUserName = null;
String lsPassword = null;
String lsDocbaseName = null;
lsUserName = PropertyReaderFactory.getInstance().getProperties().getProperty("username");
lsPassword = PropertyReaderFactory.getInstance().getProperties().getProperty("password");
lsDocbaseName = PropertyReaderFactory.getInstance().getProperties().getProperty("repository");
IDfSession loSession = null;
try {
clientx=new DfClientX();
logininfo=clientx.getLoginInfo();
logininfo.setUser(lsUserName);
logininfo.setPassword(putils.decrypt(lsPassword));
smgr.setIdentity(lsDocbaseName, logininfo);
smgr.authenticate(lsDocbaseName);
loSession=smgr.getSession(lsDocbaseName);
} catch (DfException e) {
throw new RuntimeException(e);
}
return loSession;
}
The problem I am facing is that when multiple users concurrently access the application (during load testing), it gives "error during session construction" error.
For single user it works fine.
It made me wonder if I am not creating/releasing the session correctly.
Thank you