cancel
Showing results for 
Search instead for 
Did you mean: 

Opendocument call creating orphan sessions

Former Member
0 Kudos

Hi,

We are using opendoc to link up reports from a java based web app.

The webapp creates a session and then creates a token off the session. getDefaulttoken() is being used to get the token.

The token is being used by the opendoc call to view a report.

There is a independent thread created in the app which logs off the session after the opendoc call has been made.

We are seeing that when the opendoc call is made it creates another session and it's being used to view the report.

Thus after the opendoc call there are two sessions created in the system. Our background threads goes and cleans up the first session but the session created by open doc is still there and can't be accessed by the java app for clean up.

Is this expected behavior of opendoc? is there any parameter which needs to be updated to make sure opendoc doesn't create a new session?

Thanks,

Sumit

Accepted Solutions (1)

Accepted Solutions (1)

Adam_Stone
Active Contributor
0 Kudos

Using the defaulttoken will create a new session when using opendocument. The only way for it not to create a new session is to create a wcatoken. IEnterpriseSession.getLogonTokenMgr().createWCAToken("", 5, 5). This is the way to have it share the same session instead of creating a new one. If you have code that is cleaning up the original session, you will need to be careful when you log it off, as it will effectively kill your opendocument page from being able to perform any further actions, ie paging, exporting, etc.

Former Member
0 Kudos

Hi Adam,

Thanks for your reponse.

I posted this in a message to SAP and they came back saying that there is no means to utilize OpenDoc w/o creating a new session.

They recommended using the viewer directly instead of redirecting to an opendoc call.

Opendoc creates a new session automatically whenever it's being used to open a report, using the viewer would help go around that.

Thanks,

Sumit

Former Member
0 Kudos

Hello Sumit,

Would you please explain more what is a viewer? Does it mean using viewrpt.cwr?

Former Member
0 Kudos

Sorry for the late reply.

Using viewrpt.cwr along with the WCAToken fixed the issue for us.

Thanks,

Sumit

Former Member
0 Kudos

could you please share code, i am using open doc but it is not the right way

thanks for your help

Former Member
0 Kudos

Following is the code for url reporting with Opendocument:

<%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>

<%@ page import="com.crystaldecisions.sdk.framework.CrystalEnterprise" %>

<%@ page import="com.crystaldecisions.sdk.framework.IEnterpriseSession" %>

<%@ page import="com.crystaldecisions.sdk.framework.ISessionMgr" %>

<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoStore" %>

<%@ page import="com.crystaldecisions.sdk.occa.security.ILogonTokenMgr"%>

<%

try{

String systemName = "admin-09db244eb";

String userName = "Administrator";

String password = "";

String authType = "secEnterprise";

IEnterpriseSession enterpriseSession=null;

if (enterpriseSession == null)

{

ISessionMgr enterpriseSessionMgr = CrystalEnterprise.getSessionMgr();

enterpriseSession = enterpriseSessionMgr.logon(userName, password, systemName, authType);

}

ILogonTokenMgr logonTokenMgr = enterpriseSession.getLogonTokenMgr();

String defaultToken = logonTokenMgr.createWCAToken("",20,10);

response.sendRedirect("http://admin-09db244eb:8080/OpenDocument/opendoc/openDocument.jsp?iDocID="6011"&sRefresh=Y&token="+defaultToken);

}

catch(Exception e){

}

Make the necessary changes in the code(ex: cmsname,iDocID,etc.) accordingly.

Regards,

Anuj

Former Member
0 Kudos

Following is the code for url reporting with Opendocument:

<%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>

<%@ page import="com.crystaldecisions.sdk.framework.CrystalEnterprise" %>

<%@ page import="com.crystaldecisions.sdk.framework.IEnterpriseSession" %>

<%@ page import="com.crystaldecisions.sdk.framework.ISessionMgr" %>

<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoStore" %>

<%@ page import="com.crystaldecisions.sdk.occa.security.ILogonTokenMgr"%>

<%

try{

String systemName = "admin-09db244eb";

String userName = "Administrator";

String password = "";

String authType = "secEnterprise";

IEnterpriseSession enterpriseSession=null;

if (enterpriseSession == null)

{

ISessionMgr enterpriseSessionMgr = CrystalEnterprise.getSessionMgr();

enterpriseSession = enterpriseSessionMgr.logon(userName, password, systemName, authType);

}

ILogonTokenMgr logonTokenMgr = enterpriseSession.getLogonTokenMgr();

String defaultToken = logonTokenMgr.createWCAToken("",20,10);

response.sendRedirect("http://admin-09db244eb:8080/OpenDocument/opendoc/openDocument.jsp?iDocID="6011"&sRefresh=Y&token="+defaultToken);

}

catch(Exception e){

}

Make necessary changes in the code (ex: cmsname,iDocID,etc.) accordingly.

Regards,

Anuj

Answers (0)