Getting and releasing a session
//create Client objects
IDfClientX clientx = new DfClientX();
IDfClient client = clientx.getLocalClient();
//create a Session Manager object
IDfSessionManager sMgr = client.newSessionManager();
//create an IDfLoginInfo object for user creddentials
IDfLoginInfo loginInfoObj = clientx.getLoginInfo();
loginInfoObj.setUser(<user>);
loginInfoObj.setPassword(<pass>);
loginInfoObj.setDomain(null);
//bind the Session Manager to the login info
sMgr.setIdentity(<docbase>, loginInfoObj);
IDfSession session = null;
try {
//get the IDFsession instance by using getSession or newSession
Session = sMgr.getSession(<docbase>);
//user the session to perform repository functions
……….
……….
}finally{
//release the session
sMgr.release(session);
}