Home > Discussion Forum dm_developer Discussion Forum

Go Back   dm_developer Discussion Forum > Documentum Products > Documentum 6

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old February 8, 2010, 09:03 PM
ank ank is offline
Registered User
 
Join Date: Aug 2009
Posts: 110
Correct way of making session

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
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off



All times are GMT -5. The time now is 03:11 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.