1. Bryant Burnard
  2. PowerServer 2020 or older (Obsolete)
  3. Monday, 8 November 2021 22:44 PM UTC

When trying to run a PowerServer application using PB 2021 Build 1288, I am getting the following error when trying to connect to the Oracle database:

PB application execution Error (R0222) 

Error: Session not created. Please create a session using BeginSession (Web API http://X.X.X.X:5000/api/ServerApi/ConnectAndCreateTransaction)

In the DB set up, I can test the connection set up ok, but not when I am running my application.

Any thoughts on how I can fix this? 

Accepted Answer
Bryant Burnard Accepted Answer Pending Moderation
  1. Tuesday, 9 November 2021 17:45 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # Permalink

Hi Francisco/Kai;

Yup, changed that option and I am able to connect now. It seemed to be select by default when I migrated the application. 

Thanks for your help

Bryant

Comment
There are no comments made yet.
Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 9 November 2021 03:38 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 1

Hi Bryant,

Francisco is correct. It seems you have the 'Begin session by code' option checked. This option is not selected by default, which means the session is automatically created when the application starts. If this option is selected, then the session will not be automatically created; it will be created only when the BeginSession function is executed.

Normally you may want to create a session using BeginSession after you have obtained the access token, so that the session can include the access token. Please refer to the article below for more detail.
https://docs.appeon.com/pb2021/whats_new/PowerServer_deployment.html#d0e442

Regards,
Kai

Comment
There are no comments made yet.
Francisco Martinez @Appeon Accepted Answer Pending Moderation
  1. Monday, 8 November 2021 23:14 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 2

Hi Bryant,

Is the option "Begin session by code" in the Application's "Additional Properties>PowerSever" window checked?
If so, uncheck this option and try again.

Unckecked: the application will automatically try to create the session for you
Checked: you'll have to manually create the session with BeginSession() before making any data operations

Regards,
Francisco

Comment
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.