Foren

Copy Session Time

Ridwan Islam, geändert vor 8 Jahren.

Copy Session Time

New Member Beiträge: 4 Beitrittsdatum: 11.04.14 Neueste Beiträge
We are creating a copy session when making service calls in order to use different callbacks for different requests. We are creating the copy session as follows:

LRSession *newSession = [[LRSession alloc] initWithSession:session];


We have noticed that when this runs it takes 5-10 seconds as it seems that the copy session authenticates. This causes a delay in each request being made and we have noticed performance issues in the app.

Is this the correct way to create a copy session to handle different callbacks?

Thanks,
Ridwan
thumbnail
Bruno Farache, geändert vor 8 Jahren.

RE: Copy Session Time

Liferay Master Beiträge: 603 Beitrittsdatum: 14.05.07 Neueste Beiträge
Hi Ridwan,

If you are using Basic Authentication, authentication happens on every service request you make, not when you are creating a session. I suppose it's taking 5-10 seconds during the service call, not when you create the session, correct?

Calling it "session" is misleading, it's not a persistent connection where all following requests use the same connection. We will rename it to "configuration" or something like that in future versions.

Service calls should take the same time to complete, regardless if you are cloning a session or creating a new one. Does your portal have a custom login mechanism? Does it take a long time when logging from a regular browser too? Perhaps if you use OAuth authentication, this could improved, since following requests check only for a token instead of authenticating on every request.

Are you sure problem is related to authentication? It could be that the service call is taking a long time to complete, which is not necessarily due to authentication. You can test JSONWS calls by using http://localhost:8080/api/jsonws