Hello All,
I have a major issue at a customer live site. We run into records not being saved from Clarion 11 to MS-SQL. Sometimes, aparently, the saved record shows up in the detail-list, but gets removed soon after.
Finally I found the SQL Profiler to log what’s being recieved by MSSQL.
<Event id="10" name="RPC:Completed">
<Column id="1" name="TextData">exec sp_execute 143,19037,'2022-02-11 00:00:00','2022-02-11 00:00:00',1355,0,25,'1. Producten geleverd',30216,27,3,302,'Safiland','Peper Rood','Normaal','','I ','MA',9001,'3kg ','1 ',1.00,3.000,'1',0.00,10.00,'pepro3',13.50000000,1.00,0.00000000,13.50000000,13.50000000,13.50000000,'',7096099,'','',0,NULL,'','',0,'','1 ',0,0.00,182321,0,'',0,NULL,0.00000000,0.00,'',NULL,'','',0,0.00,0,0.0000</Column>
<Column id="9" name="ClientProcessID">42992</Column>
<Column id="2" name="BinaryData">000000003E0000001400730070005F0065007800650063007500740065001400000003000600380069006E0074008F0000001400000003000600380069006E0074005D4A000032000000870018002A006400610074006500740069006D0065003200280033002900E60702000B000000000000000000000032000000870018002A006400610074006500740069006D0065003200280033002900E60702000B000000000000000000000035000000830018006A0064006500630069006D0061006C00280037002C00300029000700014B0500000000000000000000000000003700000083001A006A0064006500630069006D0061006C002800310031002C00300029000B0001000000000000000000000000000000001400000003000600380069006E007400190000003900000081001600A7207600610072006300680061007200280033003000290015000000312E2050726F64756374656E2067656C657665726435000000830018006A0064006500630069006D0061006C00280039002C00300029000900010876000000000000000000000000000035000000830018006A0064006500630069006D0061006C00280039002C00300029000900011B00000000000000000000000000000035000000830018006A0064006500630069006D0061006C00280035002C00300
029000500010300000000000000000000000000000035000000830018006A0064006500630069006D0061006C00280035002C00300029000500012E0100000000000000000000000000002C00000081001600A7207600610072006300680061007200280032003500290008000000536166696C616E642E00000081001600A720760061007200630068006100720028003500300029000A000000506570657220526F6F642B00000081001600A72076006100720063006800610072002800320030002900070000004E6F726D61616C2400000081001600A72076006100720063006800610072002800320035002900000000003800000081001600A720760061007200630068006100720028003200300029001400000049202020202020202020202020202020202020202600000081001600A72076006100720063006800610072002800320030002900020000004D4135000000830018006A0064006500630069006D0061006C00280039002C0030002900090001292300000000000000000000000000003800000081001600A7207600610072006300680061007200280032003000290014000000336B6720202020202020202020202020202020202E00000081001600A720760061007200630068006100720028003100300029000A0000003120202020202020202035000000830018006A0064006500630069006D0
061006C00280037002C00320029000702016400000000000000000000000000000035000000830018006A0064006500630069006D0061006C00280039002C0033002900090301B80B00000000000000000000000000002300000081001400A7207600610072006300680061007200280031002900010000003135000000830018006A0064006500630069006D0061006C00280037002C0032002900070201000000000000000000000000000000003700000083001A006A0064006500630069006D0061006C002800310031002C00320029000B0201E80300000000000000000000000000002A00000081001600A7207600610072006300680061007200280031003200290006000000706570726F333700000083001A006A0064006500630069006D0061006C002800310035002C00380029000F0801805D775000000000000000000000000035000000830018006A0064006500630069006D0061006C00280037002C0032002900070201640000000000000000000000000000003700000083001A006A0064006500630069006D0061006C002800310035002C00380029000F0801000000000000000000000000000000003700000083001A006A0064006500630069006D0061006C002800310035002C00380029000F0801805D77500000000000000000000000003700000083001A006A0064006500630069006D0061006
C002800310039002C0038002900130801805D77500000000000000000000000003700000083001A006A0064006500630069006D0061006C002800310039002C0038002900130801805D77500000000000000000000000002200000081001400A7207600610072006300680061007200280031002900000000001400000003000600380069006E00740023476C002200000081001400A7207600610072006300680061007200280036002900000000002400000081001600A72076006100720063006800610072002800320030002900000000001900000011000E003000740069006E00790069006E0074000022000000870018002A406400610074006500740069006D00650032002800330029002400000081001600A72076006100720063006800610072002800340030002900000000002600000081001800A720760061007200630068006100720028003100300030002900000000001400000003000600380069006E007400000000002200000081001400A7207600610072006300680061007200280038002900000000002600000081001600A720760061007200630068006100720028003200300029000200000031201400000003000600380069006E007400000000003700000083001A006A0064006500630069006D0061006C002800310033002C00320029000D0201000000000000000000000000000000001
400000003000600380069006E00740031C802001400000003000600380069006E007400000000002400000081001600A72076006100720063006800610072002800310038002900000000001900000011000E003000740069006E00790069006E0074000022000000870018002A406400610074006500740069006D00650032002800330029003700000083001A006A0064006500630069006D0061006C002800310035002C00380029000F0801000000000000000000000000000000003700000083001A006A0064006500630069006D0061006C002800310031002C00320029000B0201000000000000000000000000000000002400000081001600A720760061007200630068006100720028003100300029000000000022000000870018002A406400610074006500740069006D00650032002800330029002600000081001800A720760061007200630068006100720028003100390039002900000000002600000081001800A720760061007200630068006100720028003100390039002900000000001900000011000E003000740069006E00790069006E0074000035000000830018006A0064006500630069006D0061006C00280037002C0032002900070201000000000000000000000000000000001400000003000600380069006E007400000000003700000083001A006A0064006500630069006D0061006C0
02800310031002C00340029000B0401000000000000000000000000000000001400000003000600380469006E007400FCFFFFFF</Column>
<Column id="10" name="ApplicationName">InVerVo</Column>
<Column id="11" name="LoginName">invervo</Column>
<Column id="12" name="SPID">81</Column>
<Column id="13" name="Duration">2965</Column>
<Column id="14" name="StartTime">2022-02-11T10:35:03.49+01:00</Column>
<Column id="15" name="EndTime">2022-02-11T10:35:03.493+01:00</Column>
<Column id="16" name="Reads">3</Column>
<Column id="17" name="Writes">0</Column>
<Column id="18" name="CPU">16</Column>
<Column id="35" name="DatabaseName">Invervo</Column>
</Event>
What I noticed is the fact that the Writes are zero. When I look at the other records saved, the Writes are from 1 to 5 or so.
I am not the programmer myself (I am the product owner, who has a bit of programming experience, so I can read the code quite a bit), but my programmers have been stuck with this issue for a week nog (so I spend this weekend testing and extracting from milions of log lines)
The code involved looks straight forward: It creates a new “NrInLine”, to register the next number to be used for this order. The SalesRecords table also contains an auto number field.
The last 2 rows of code is where I feel things are failing
LOC:NrInLine = 0
Clear(SalesRecords2)
SLR2:Ordernumber = SAL:Ordernumber
SLR2:NrInLine = 99999999999999
Set(SLR2:KeyOrderLine,SLR2:KeyOrderLine)
Previous(SalesRecords2) //Due to translation error this said SalesLines before.
LOC:NrInLine = SLR2:NrInLine + 1
Clear(SLR2:Record)
If LOC:NrInLine <= 0
LOC:NrInLine = 1
end
SLR1:NrInLine = LOC:NrInLine
SLR1:InvoiceNumber = SAL:InvoiceNumber
IF Access:SalesRecords1.TryInsert() <> Level:Benign
Message(ErrorCode() & ' ' & Error() & '|' & FILEERRORCODE() & ':' & CLIP(FILEERROR()) )
There is a TryInsert, and the result is obviously benign, otherwise the user should have had an error warning (we also tested with a lot of trace logging, and it shows the same path of execution.
But whilest Clarion tells us, all is well, the SQL database has found no reason to save it.
I would welcome any bright idea on the matter.
(Code above is translated by me. Actual source has Dutch fields and variables)