Hi
Recently migrated to Powerserver 2022 build 1878, works wonders, now I'm ironing out some rough edges that appear ;)
The program in C/S delays but does not display any messages, but from Powerserver several database connection error windows appear and finally it brings the data.
When doing in a dw_1.retrieve(), from Powerserver, (a query that takes 5 seconds from outside of Powerbuilder); the DBerror event is fired with SQLDBCode=-1, showing the failed to connect window.
But in the execution of the program several attempts are made before firing the final error message.
After several database connection error messages, the data is brought to the datastore and displayed correctly.
Is there a way in Powerserver to manipulate the timeout for dw_1.retrieve() before the dberror() event is fired. ?
Thanks a lot
Damian
The app is working fine and works great.
In certain Datawindows, it is created at runtime the fields, properties, and others are injected dynamically, (sql text is asigned in sqlpreview() event ). When performing the retrieve(), the dberror() event returns the following error message:
(-1) "Select Error: Failed to create the datastore." But, after several retries, the data is brought to the datawindow and displays it correctly
To work around this wrap all dberror() event handling inside the following if:
if not (ispowerserverapp() and SQLErrText="Select Error: Failed to create the datastore") then
......[powerscript commands]....
end if
and the problem was solved in powerserver (in C/S it doesn't give problems).
I calculate that by solving this temporary error, I may avoid control of another possible error of the same nature.
Is there a better way to handle this error?
I attach log file that is generated in:
c:\inetpub\wwwroot\webapi\logging\logs\powerserver.log
when performing the retrieve()
Thanks a lot
********************************************************************************************************************************************
c:\inetpub\wwwroot\webapi\logging\logs\powerserver.log
*******************************************************************************************************************************************
2023-01-02 09:33:26,530 ERROR PowerServer. [0] - MESSAGE: Transaction is rollbacked. please call Commit()/Rollback() on DataContext after BeginTransaction(). at SnapObjects.Data.DataContext.Dispose()
at .Dispose()
at .()
at ..MoveNext()
--- End of stack trace from previous location ---
at ..MoveNext()
--- End of stack trace from previous location ---
at ..MoveNext()
2023-01-02 09:33:26,533 ERROR PowerServer.Api.ServerApiController.OnActionExecuted [0] - MESSAGE: 'PowerServer.Api.ServerApiController.CommitAndCreateTransaction (PowerServer.Api)' get result (
{
"IsSuccess": false,
"RequestId": null,
"AppName": "CGesem",
"NameSpace": "CGesem",
"ErrorCode": 0,
"ErrorMessage": "Transaction is rollbacked. please call Commit()/Rollback() on DataContext after BeginTransaction()."
}).
2023-01-02 09:33:26,540 ERROR PowerServer. [0] - MESSAGE: Failed to commit because there is no available database connection or transaction at ..MoveNext()
--- End of stack trace from previous location ---
at ..MoveNext()
--- End of stack trace from previous location ---
at ..MoveNext()
2023-01-02 09:33:26,542 ERROR PowerServer.Api.ServerApiController.OnActionExecuted [0] - MESSAGE: 'PowerServer.Api.ServerApiController.CommitAndCreateTransaction (PowerServer.Api)' get result (
{
"IsSuccess": false,
"RequestId": null,
"AppName": "CGesem",
"NameSpace": "CGesem",
"ErrorCode": 0,
"ErrorMessage": "Failed to commit because there is no available database connection or transaction"
}).
2023-01-02 09:33:26,560 ERROR PowerServer. [0] - MESSAGE: Failed to commit because there is no available database connection or transaction at ..MoveNext()
--- End of stack trace from previous location ---
at ..MoveNext()
--- End of stack trace from previous location ---
at ..MoveNext()
2023-01-02 09:33:26,562 ERROR PowerServer.Api.ServerApiController.OnActionExecuted [0] - MESSAGE: 'PowerServer.Api.ServerApiController.CommitAndCreateTransaction (PowerServer.Api)' get result (
{
"IsSuccess": false,
"RequestId": null,
"AppName": "CGesem",
"NameSpace": "CGesem",
"ErrorCode": 0,
"ErrorMessage": "Failed to commit because there is no available database connection or transaction"
}).
2023-01-02 09:33:26,569 ERROR PowerServer. [0] - MESSAGE: Failed to commit because there is no available database connection or transaction at ..MoveNext()
--- End of stack trace from previous location ---
at ..MoveNext()
--- End of stack trace from previous location ---
at ..MoveNext()
2023-01-02 09:33:26,571 ERROR PowerServer.Api.ServerApiController.OnActionExecuted [0] - MESSAGE: 'PowerServer.Api.ServerApiController.CommitAndCreateTransaction (PowerServer.Api)' get result (
{
"IsSuccess": false,
"RequestId": null,
"AppName": "CGesem",
"NameSpace": "CGesem",
"ErrorCode": 0,
"ErrorMessage": "Failed to commit because there is no available database connection or transaction"
}).
2023-01-02 09:33:26,583 ERROR PowerServer. [0] - MESSAGE: Failed to commit because there is no available database connection or transaction at ..MoveNext()
--- End of stack trace from previous location ---
at ..MoveNext()
--- End of stack trace from previous location ---
at ..MoveNext()
2023-01-02 09:33:26,585 ERROR PowerServer.Api.ServerApiController.OnActionExecuted [0] - MESSAGE: 'PowerServer.Api.ServerApiController.CommitAndCreateTransaction (PowerServer.Api)' get result (
{
"IsSuccess": false,
"RequestId": null,
"AppName": "CGesem",
"NameSpace": "CGesem",
"ErrorCode": 0,
"ErrorMessage": "Failed to commit because there is no available database connection or transaction"
}).
2023-01-02 09:33:26,592 ERROR PowerServer. [0] - MESSAGE: Failed to commit because there is no available database connection or transaction at ..MoveNext()
--- End of stack trace from previous location ---
at ..MoveNext()
--- End of stack trace from previous location ---
at ..MoveNext()
2023-01-02 09:33:26,594 ERROR PowerServer.Api.ServerApiController.OnActionExecuted [0] - MESSAGE: 'PowerServer.Api.ServerApiController.CommitAndCreateTransaction (PowerServer.Api)' get result (
{
"IsSuccess": false,
"RequestId": null,
"AppName": "CGesem",
"NameSpace": "CGesem",
"ErrorCode": 0,
"ErrorMessage": "Failed to commit because there is no available database connection or transaction"
}).