NetTalk Central

Author Topic: NetWebServiceMethod - p_web.ErrorCode() incorrect  (Read 4473 times)

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
NetWebServiceMethod - p_web.ErrorCode() incorrect
« on: March 26, 2019, 06:13:10 AM »
Hi,

Using PostgreSQL, when a record is deleted and an error occurs because of a FK constraint, the value of p_web.ErrorCode() is not correct. It seems as of the underlying Clarion values of ERRORCODE(), ERROR(), FILEERRORCODE() and FILEERROR() have been altered because other Clarion statements that have also been executed - and not directly after the DELETE statement.

I get the following back in the error description:

Error occured Deleting the record 30] Entry Not Found 0

which indicates error 30 that is "A GET to a QUEUE has failed" according to Clarion help. The actual error when running the delete against SQL is this:

The DELETE statement conflicted with the REFERENCE constraint "FK_dbo.TripExpenses_dbo.Trips_trip_ID". The conflict occurred in database "Commalong", table "dbo.TripExpenses", column 'trip_ID'.

So the error in the response does not show the correct reason.

Thanks
Thys

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: NetWebServiceMethod - p_web.ErrorCode() incorrect
« Reply #1 on: March 26, 2019, 11:24:18 PM »
you'll need to be more specific as to the exact code (and code context) of the call to delete.
ie, post the code where the delete is happening.

cheers
Bruce

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: NetWebServiceMethod - p_web.ErrorCode() incorrect
« Reply #2 on: March 26, 2019, 11:34:04 PM »
Hi Bruce.

This happens in the DeleteRecord:* routine, where p_web.AddServiceError() is called if the delete was not successful. So the value of p_web.ErrorCode() used in that statement returns 30 with p_web.Error() being "Entry not found" - referring to a queue read error. But the actual underlying error code should have been 90 (File System Error) with p_web.FileError() describing why the record can't be deleted. But p_web.FileErrorCode() returns 0, so my only conclusion is that some other Clarion statements where executed after the delete was done, before the value NetWebServerWorkerBase.LastError is set.

Thys