1. mike S
  2. PowerServer
  3. Thursday, 5 January 2023 20:18 PM UTC

It appears that shared object processing (SharedObjectRegister, SharedObjectGet, etc) is supported in powerserver 2022+?

 

How does the use of shared objects affect licensing / sessions in powerserver?  When i connect and use the database (webapi) in a shared object, does it use the same session id as the main thread, or does it create another session?  If it creates another session, then i assume it uses up a licensed session count?  

 
 
Accepted Answer
Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Friday, 6 January 2023 07:39 AM UTC
  2. PowerServer
  3. # Permalink

Hi Mike,

I think SharedObjectRegister, and SharedObjectGet are supported in PowerServer 2021 and later. It should use the same session id as the main thread because it's in the same application that started the session.

You can only get one session id when the cloud app sends a request to Web API Server the first time, or when you turn on the "Begin session by code" option and call the applicationname.BeginSession method manually to start the session (https://docs.appeon.com/pb2022/powerscript_reference/BeginSession_func.html)

The session id will never change until this cloud app is closed. When you connect a different database, only the transaction id may be changed. 

BTW:

You can see the session id and transaction id in the PowerServer log if enabled (Open Logging.json or Logging.Development.json, set the log output level to Debug, and set both EnableSessionLog and EnableTransactionLog options to true.).

Or call PowerServer Management API to verify the count of the session: https://docs.appeon.com/ps2022/APIs_for_managing_session.html#Session_GetSessionCount

Regards,

Logan

 

 

 

 

Comment
  1. Chris Pollach @Appeon
  2. Friday, 6 January 2023 15:01 PM UTC
Thanks Logan .. that is even better than what I first thought! :-)
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 5 January 2023 20:36 PM UTC
  2. PowerServer
  3. # 1

Hi Mike;

  All that the PS 2022 server cares about is one Transaction Object => PS mapping execution wise. However, each TO => PS session takes up one PS license. So for example, a PB App having 4  concurrent TO's (using shared objects or not) that are all connected takes up 4 concurrent PS sessions (licenses). So say that you have a 150 PS license, then 150 / 4 = 37.5 (or 37) would be the maximum number of PB App instances that you could run. The 38th would blow your 150 PS license model.

  Now, if all the shared objects were using the same TO pointer - then you could have 150 instances of the PB running. Also, if the TO's being used were designed using a pseudo-conversational model (connect, process, disconnect), then the concurrent PS Sessions would be low.

HTH

Regards ... Chris

Comment
  1. mike S
  2. Thursday, 5 January 2023 21:36 PM UTC
"if all the shared objects were using the same TO pointer" - my understanding is that each "shared object" has its own global copies, nothing is shared, so this wouldn't be possible.



the connect/process/disconnect is what makes the most sense, but unless a throttle/queue is implemented, then the total number of sessions in use would be very hard to predict.
  1. Helpful 1
  1. Chris Pollach @Appeon
  2. Friday, 6 January 2023 02:18 AM UTC
Hi Mike;

No, you can just pass the address of SQLCA to all the Shared Objects and they can use that one TO if you like them too. ;-)

You can see this aspect in action in this example i wrote ...

http://chrispollach.blogspot.com/2022/04/multithread.html

HTH

Regards ... Chris
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.