Hi
Having issue with a ParentNullAllowed relationship when saving from DDO.
WebApp_Session related to WebApp_User with a ParentNullAllowed enabled.
Everything is fine from Tables definition. The child related field allows NULL values.
Code:
Class cWebApp_SessionWsDataDictionary is a cWsDataDictionary
Procedure Construct_Object
Forward Send Construct_Object
Set Main_File to WebApp_Session.File_Number
Set Add_Server_File to WebApp_User.File_Number
Set ParentNullAllowed WebApp_User.File_Number to True
...
The failed test case is when trying to create a session without a user specified.
I can save the record using db-Explorer, and not providing any value to session.iRn_User column/field.
When doing it from db-explorer, the statement that DB2 receives is like this:
Code:
INSERT INTO "APPCTRL"."WEBAPP_SESSION" ("SESSIONKEY", "DTCREATETS", "DTLASTACCESSTS", "IUSECOUNT", "SREMOTEADDRESS", "BACTIVE") VALUES (?, ?, ?, ?, ?, ?)
As you can see, the iRn_User column is missing in the insert statement as expected.
But when trying to create the same kind of record from DDO (Request save) the produced statement is :
Code:
INSERT INTO "APPCTRL"."WEBAPP_SESSION" ("SESSIONKEY", "DTCREATETS", "DTLASTACCESSTS", "IUSECOUNT", "SREMOTEADDRESS", "IRN_USER", "BACTIVE") VALUES (?, ?, ?, ?, ?, ?, ?)
And the insert fails with SQL0530N error.
Code:
D:\Projetos\DataFlex\Igreja\Recovery Media Repository\RecoveryMediaRepository_ws\Programs\WebApp.exe
Erro genérico 23503 (-530)--[IBM][CLI Driver][DB2/NT64] SQL0530N The insert or update value of the FOREIGN KEY "APPCTRL.WEBAPP_SESSION.WEBAPP_SESSION_WEBAPP_USER_FK" is not equal to any value of the parent key of the parent table. SQLSTATE=23503
Table = WEBAPP_SESSION (7), Source = DB2_DRV.Save
Erro número: 12289 linha: 5034.
MSG_UNHANDLEDERRORDISPLAY (4737) - oWsWebErrorHandler (51) - at address 6639
MSG_MAINERRORREPORT (4718) - oWsWebErrorHandler (51) - at address 6431
MSG_ERROR_REPORT (433) - oWsWebErrorHandler (51) - at address 6498
MSG_ERROR_REPORT (433) - oWsWebErrorHandler (51) - at address 31396
MSG_REQUEST_SAVE (375) - oObject (79) - at address 4532
GET_CREATESESSION (5847) - oSessionManager (71) - at address 32523
GET_PROCESSREQUESTHEADER (6606) - oWebApp (24) - at address 24945
GET_CALLACTION (6514) - oWebApp (24) - at address 24737
GET_CALLACTION (6514) - oWebServiceDispatcher (45) - at address 24431
GET_DOCALL (1284) - oCallInterface (46) - in native code
GET_DOCALL (1284) - oWebServiceDispatcher (45) - at address 13579
MSG_ONDFFUNC (5253) - oVDFInetSession (35) - at address 12148
MSG_STARTWEBAPP (6061) - oWebApp (24) - at address 19595
[start] - at address 32961
This is really critical. Please I need further assistance to determine if I am doing something wrong, but I really don't think so.
PS. I was not sure which forum this should be posted. Please move it around if necessary.
Regards