1. Richard Frantz
  2. PowerBuilder
  3. Wednesday, 19 April 2023 20:24 PM UTC

Problem with PFC multitable update process... only the first registered configuration actually saves.

NO ERRORS are thrown.

In dw constructor:

ll_rc = this.inv_multitable.of_register(ls_update_table1, ls_keycolumns, ls_updateables, false, 0)

ll_rc = this.inv_multitable.of_register(ls_update_table2, ls_keycolumns, ls_updateables, false, 0)

Table 1 saves

switch it up

ll_rc = this.inv_multitable.of_register(ls_update_table2, ls_keycolumns, ls_updateables, false, 0)

ll_rc = this.inv_multitable.of_register(ls_update_table1, ls_keycolumns, ls_updateables, false, 0)

Table 2 saves.

I've stepped though the debugger and it loops though both configurations and calls the update, good return code, but the change does not go to the database.

Any thoughts?

PB 12.5 Win10 sql server 2019

Richard Frantz Accepted Answer Pending Moderation
  1. Wednesday, 19 April 2023 21:28 PM UTC
  2. PowerBuilder
  3. # 1

I did that already, the database is only getting the first update sql. The second dw.update() does not send anything up.

Comment
  1. John Fauss
  2. Thursday, 20 April 2023 13:12 PM UTC
Where/when is dw.ResetUpdate() being called? From your description, it sounds as if ResetUpdate for all DW's is being called after the first DW registered with the Multi-Table service has completed its Update() call.
  1. Helpful
  1. Richard Frantz
  2. Thursday, 20 April 2023 17:03 PM UTC
Yes, that is exactly what it "seems" to be doing by the behavior, but that is not what the code says. The resetupdate is outside of the loop through the datawindows.



// Update the DataWindow, Make sure the Flags are Not Reset.

li_rc = idw_Requestor.Update ( ab_accepttext, FALSE )

IF li_rc <> 1 THEN Return li_rc

NEXT

// Restore the update characteristics to their original settings.

li_rc = of_RestoreUpdateSettings ( lnv_originalupdate )

If li_rc < 0 Then Return li_rc



// All updates have succesfully occurred, Reset the flags if appropriate.

IF ab_resetflags = TRUE THEN idw_Requestor.ResetUpdate ( )
  1. Helpful
  1. John Fauss
  2. Thursday, 20 April 2023 17:59 PM UTC
My only remaining suggestion is to make a local copy of pfc_n_cst_dwsrv_multitable, edit the of_update function (that you've quoted above) and add some code to inspect the ModifiedCount() of both DW's and run through the debugger. If the second DW in the multi-table update array shows no modified rows, then painstakingly backtrack earlier and earlier in the save process until you see/find where conditions are not what is expected. You may have to also make a local copy of the descendant n_cst_dwsrv_multitable object and regenerate it after altering code in the pfc-layer object.
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 19 April 2023 21:18 PM UTC
  2. PowerBuilder
  3. # 2

Hi, Richard -

If it was me, I would first enable the database interface trace (SQLCA.DBMS="TRACE xxx"), so that you can actually see what SQL is being sent to the SQL Server database. That might provide you with some clues.

Best regards, John

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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.