1. S&F Datentechnik
  2. PowerServer
  3. Wednesday, 27 September 2023 15:02 PM UTC

Hello,

When ALTER commands are used in our cloud program and are executed from a second transaction object, the connection to the database is disconnected from the first transaction object.

I have already tried to reproduce the problem in a genapp, but the database connection was not disconnected.

The source code and transaction objects are almost identical.

But I don't see the problem.

Does anyone have any idea why this might be?

Regards,

Jan Weerts

Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 27 September 2023 17:23 PM UTC
  2. PowerServer
  3. # 1

Have you tried enabling LongConnection property?  https://docs.appeon.com/ps2022r2/Enabling_long_connections.html

Comment
  1. S&F Datentechnik
  2. Thursday, 28 September 2023 07:36 AM UTC
That worked.

Thanks for the comment.

However, we will first test this change further to avoid subsequent errors.
  1. Helpful
  1. mike S
  2. Thursday, 28 September 2023 10:50 AM UTC
I would not share the database connection (which is the default in powerserver) if you are having the users log in to the database with their own login/pwd. Use longconnection if that what you are planning on doing.
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Wednesday, 27 September 2023 15:45 PM UTC
  2. PowerServer
  3. # 2

what alter command?

 

are you changing the table structure - alter table add column...?

 

and what does PS log have in it?  if this is running in IIS check windows event log, otherwise check the logging system of however you deployed it.

 

Comment
  1. S&F Datentechnik
  2. Thursday, 28 September 2023 06:45 AM UTC
We are using "ALTER LOGIN" and executing it with "EXECUTE IMMEDIATE"



And this is what the Windows event log has:



"ErrorMessage": "Login failed for user \"test\".

Execution cannot continue because the session is in KILL status

A severe error occurred on the current command. The results, if any, should be discarded."
  1. Helpful
  1. Miguel Leeuwe
  2. Thursday, 28 September 2023 09:29 AM UTC
Maybe I'm stupid, but if you are logged in and then change the login, it seems only logical that you've broken you logged in connection.

Correct me if I'm wrong.
  1. Helpful 1
  1. S&F Datentechnik
  2. Thursday, 28 September 2023 14:43 PM UTC
Yes if you think logical but in this case its shoud be still connected.
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Wednesday, 27 September 2023 19:20 PM UTC
  2. PowerServer
  3. # 3

and what version of powerserver?

Comment
  1. S&F Datentechnik
  2. Thursday, 28 September 2023 06:26 AM UTC
PowerServer 2022
  1. Helpful
There are no comments made yet.
S&F Datentechnik Accepted Answer Pending Moderation
  1. Thursday, 5 October 2023 10:46 AM UTC
  2. PowerServer
  3. # 4

Hello,

Is it normal for ALTER commands to disconnect the database when using two transaction objects?

Or is this due to an option in the transaction object.

LongConnection is such a command, but I still can't reproduce the error in my genapp even though Longconnection is set to 0.

Does anyone know why this is?

Regards, Jan Weerts

Comment
  1. Logan Liu @Appeon
  2. Saturday, 7 October 2023 07:39 AM UTC
Hi Jan Weerts,

I'd like to share a few suggestions:

1) If this issue only exists in the Cloud App, it is important to understand the following connection differences between the PowerBuilder traditional C/S app and the PowerServer installable cloud app. In the installable cloud application, the database connection is made from PowerServer (not from the client), and the database connection is ended and returned to the connection pool when the transaction is completed. This database connection is called "short-lived connections". Refer to: https://docs.appeon.com/ps2022r2/Connection_differences.html

E.g.: if you change the password of a login in session, I suggest that you restart the application to make sure the database connection information is correct for all transaction objects. Otherwise, another transaction object may also use the old connection string to connect the database once needed. Alternatively, you can enable LongConnection.

2) Another possible reason for the Kill state is the database needs to be repaired. E.g.: https://stackoverflow.com/questions/40449982/cannot-continue-the-execution-because-the-session-is-in-the-kill-state-while-bu

3) It would be better if you could reproduce this issue, or provide the PowerServer Web API log (https://docs.appeon.com/ps2022r2/PowerServer_logs.html) that may contain more details about this database error.

Regards, Logan
  1. Helpful 2
  1. S&F Datentechnik
  2. Wednesday, 11 October 2023 09:30 AM UTC
Hello Logan,

Thanks for the comment.

Regarding the 3rd point you wrote.

I can reproduce the problem, but only with our PFC files, not with a newly created Genapp.

Hence the question about possible settings in the transaction object that disconnect the database connection.

And about your 2nd point the Database is not the Problem.

Regards Jan
  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.