Hello Experts,
I am trying to copy some objects from one docbase to another. Therefore, I need a session for both docbases. So, I create a session like in my this discussion. https://community.emc.com/message/715260#715260 . If I create a session in this way and call copy operation, it successfully copies the objects from source to target. If I create a module in this way, it works fine everywhere, in composer, in jms and in process builder.
==============================
sessionManager.setIdentity("REPOSITORY1", loginInfo);
peerSession=sessionManager.newSession("REPOSITORY1");
//Create session in second docbase
loginInfo.setUser("dmadmin");
loginInfo.setPassword("pass2");
loginInfo.setDomain(null);
sessionManager.setIdentity("REPOSITORY2", loginInfo);
peerSession=sessionManager.getSession("REPOSITORY2");
//Object to be copied in current docbase where the module is running IDfSysObject sysObj=(IDfSysObject) peerSession.getObject(new DfId("09026c198006e946")); //Destination folder in destination docbase IDfSysObject sysObj2=(IDfSysObject) peerSession.getObject(new DfId("0c00001680054ee1")); IDfCopyOperation copyOpr=clientX.getCopyOperation(); copyOpr.setSession(peerSession); copyOpr.setDestinationFolderId(sysObj2.getObjectId()); //sysObj2 is destination folder IDfCopyNode node=(IDfCopyNode) copyOpr.add(sysObj); copyOpr.execute(); IDfClient client=
Now, if I use get session method of the module for instead of hard coding the docbase credentials,
sessionManager;
IDfSession peerSession;
//Create session in first docbase
//loginInfo.setUser("dmadmin");
//loginInfo.setPassword("pass1");
//loginInfo.setDomain(null);
//sessionManager.setIdentity("REPOSITORY1", loginInfo);
//peerSession=sessionManager.newSession("REPOSITORY1");
peerSession=getSession();
sessionManager=peerSession.getSessionManager();
//Create session in second docbase
loginInfo.setUser("dmadmin");
loginInfo.setPassword("pass2");
loginInfo.setDomain(null);
sessionManager.setIdentity("REPOSITORY2", loginInfo);
peerSession=sessionManager.getSession("REPOSITORY2");
//Object to be copied in current docbase where the module is running IDfSysObject sysObj=(IDfSysObject) peerSession.getObject(new DfId("09026c198006e946")); //Destination folder in destination docbase IDfSysObject sysObj2=(IDfSysObject) peerSession.getObject(new DfId("0c00001680054ee1")); IDfCopyOperation copyOpr=clientX.getCopyOperation(); copyOpr.setSession(peerSession); copyOpr.setDestinationFolderId(sysObj2.getObjectId()); //sysObj2 is destination folder IDfCopyNode node=(IDfCopyNode) copyOpr.add(sysObj); copyOpr.execute(); IDfClient client=
This code works fine in composer and process builder but in JMS with P06 it throws "Using session handle that has already been released" exception. See error1.txt for details.
Now, if I modify my code like this and try to create a new session insted of using the one returned by getSession() method of the module.
sessionManager=client.newSessionManager();
IDfSession peerSession; IDfSession session;
//Create session in first docbase loginInfo.setUser(session.getLoginInfo().getUser()); loginInfo.setPassword(session.getLoginTicket()); loginInfo.setDomain(session.getLoginInfo().getDomain()); if(!sessionManager.hasIdentity(session.getDocbaseName())) sessionManager.setIdentity(session.getDocbaseName(), loginInfo); peerSession=sessionManager.newSession(session.getDocbaseName());
//Create session in second docbase
loginInfo.setUser("dmadmin");
loginInfo.setPassword("pass2");
loginInfo.setDomain(null);
sessionManager.setIdentity("REPOSITORY2", loginInfo);
peerSession=sessionManager.getSession("REPOSITORY2");
//Object to be copied in current docbase where the module is running IDfSysObject sysObj=(IDfSysObject) peerSession.getObject(new DfId("09026c198006e946")); //Destination folder in destination docbase IDfSysObject sysObj2=(IDfSysObject) peerSession.getObject(new DfId("0c00001680054ee1")); IDfCopyOperation copyOpr=clientX.getCopyOperation(); copyOpr.setSession(peerSession); copyOpr.setDestinationFolderId(sysObj2.getObjectId()); //sysObj2 is destination folder IDfCopyNode node=(IDfCopyNode) copyOpr.add(sysObj); copyOpr.execute(); IDfClient client=
This time, it throws "Session is not owned by this session manager" exception. Please see error2.txt for details.
Note that this problems occur after installing P06. Please help me to identify what is the cause and how I can fix it. I can't uderstand why it works when I hard code the credentials but when I use credentials of other session it does not. I really can't understand what is the difference between these two.
Thanks in advance