cancel
Showing results for 
Search instead for 
Did you mean: 

Portal Service Concurrency

Former Member
0 Kudos

Hi,

When I request a reference to a portal service (com.sapportals.portal.prt.service.IService) using WDPortalUtils.getServiceReference(...), then do I get a reference to an instance (of that service) that is not used at that moment? Or do I have to take into account the possibility of two clients invoking the same instance at the same time?

Thanks,

Jeroen

Accepted Solutions (1)

Accepted Solutions (1)

detlev_beutner
Active Contributor
0 Kudos

Dag Jeroen,

Portal Services are implemented as Singletons. That is, every code referencing a portal service references the same instance. <i>The service itself</i> should be aware of possible parallel calls of it's service methods (and consider synchronizing, if needed).

So your client code <i>should not</i> care about this "problem".

Hope it helps

Detlev

Former Member
0 Kudos

Hi Detlev,

So if I understand well, I can share my service instance variables between all clients invoking the service?

Thanks,

Jeroen

detlev_beutner
Active Contributor
0 Kudos

Dag Jeroen,

So we are talking of <i>your own</i> service implementation!?

Yes, instance variables in general are shared within a service, but keep in mind that in cluster environments there is one instance of the service on each node.

Hope it helps

Detlev

Former Member
0 Kudos

Detlev,

Yes indeed I'm implementing a service myself. So to rephrase my question: is it me that is responsible for concurrency control (in my service implementation), or is the framework in which my service is running responsible?

Thanks,

Jeroen

detlev_beutner
Active Contributor
0 Kudos

Hi Jeroen,

It's you.

Hope it helps

Detlev

Answers (0)