[RDMLX]What if network connection lost during uploading

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
MegumiSawada
Posts: 260
Joined: Tue Feb 19, 2013 5:18 pm

[RDMLX]What if network connection lost during uploading

Post by MegumiSawada » Fri Jan 29, 2016 12:25 pm

Hi,

I would like to ask the intended behavior when network connection is lost during uploading offline data.

What is the intended behavior in the following cases? :
Case1: Network connection is lost during sending local data (of Sqlite) to Server

Case2: Upload is completed but network connection is lost during writing received data in LANSA database tables
Especially when uploaded data is huge it would take time so network connection could be lost during LANSA handles these data.

Some error messages like "Network connection is required" will be shown in both case?
Or jobs will be terminated and require re-try?
I would like to know what will happen in these cases and what is expected behavior.

Best Regards,
Megumi

tsupartono
Posts: 289
Joined: Wed Apr 18, 2012 10:21 am

Re: [RDMLX]What if network connection lost during uploading

Post by tsupartono » Mon Feb 01, 2016 10:01 am

Megumi,
From the LR client's perspective, there is no difference between case 1 and 2 as the server program has failed to indicate that it has fully received the uploaded data. So it's correct that you will receive the same response for both 1 and 2.

LR client will NOT reset the modified flags of the rows if the server doesn't indicate that it is happy with the data it received, so the next time you initiate an upload, the LR client will re-submit the rows.

When your end-users often see this message, it's a good idea to split to upload into multiple chunks. The chunks will then be sent to the server in multiple HTTP requests, so your server program can respond faster to each request and avoid the timeout error.

You can specify the (estimated) chunk size (in bytes). Once this number of bytes is reached, it would be the end of the current chunk. LR will then immediately send the current chunk to the server. Once it has received a response from the server, it will continue with the next chunk.
Note however that the smallest unit in the transfer is a row, so LR will not split one row between chunks, which means the size of the chunk will not be exactly the same as the number you specify.

For example, to specify a chunk size of (approximately) 1024 KB (1M), you would do this:

Code: Select all

LRNG_AssignNumToProp(1048576 : '/SysStates.DbUploadSegmentSizeLimit');
Note that since you are modifying a system state, it's persistent and affects subsequent transfer. So if that's not your intention, you would need to reset the limit to the desired value prior to every transfer.

Your server program can tell if it's the last chunk or not by reading the property 'DB.HasMoreData'

Before deciding to go ahead with the multi-chunk approach, it would be best to first conduct a test to see if it's appropriate for your situation, and if it's working as intended.

MarcusLancaster
Posts: 46
Joined: Wed Nov 06, 2013 1:28 am

Re: [RDMLX]What if network connection lost during uploading

Post by MarcusLancaster » Thu Jul 27, 2017 7:03 pm

Hi.

I wonder if you can provide any more info with regard to the DbUploadSegmentSizeLimit feature - I've searched the doco and can't see anything obvious.

Specifically, can you confirm that LR handles the chunking of data at the low level? In other words as far as the client and server reusable are concerned when the client issues something like this;

this_q_setProperties({
'RunOperation.Type' : 'PerformAction',
'RunOperation.Action' : 'UPLOAD',
'RunOperation.PGM' : 'MYPGM',
'RunOperation.SendDBData' : 'Y'});


LR then takes over and automatically sends the data in chunks up to the server, and it is only when all the data is sent that the server program MYPGM is kicked off and receives the uploaded data in one go, as if it had not been chunked?

Does it matter where the DbUploadSegmentSizeLimit property is set? Should it be set in the "offline" reusable, or in the server reusable which is handling the Action? Also, once set, what is the scope - for example if an app permits different data uploads in different offline forms (but all part of the same app) does the setting of that property persist across all forms?

Is that property always "on"? If so what is the default (something very large so that data is always passed in a single chunk?). In other words, if this has been turned on for one upload, how would I reset it back to "default" mode for other uploads in the same app.

You indicate that the actual chunk size may not be exactly as you specify - given that uploading table rows will not be split - so does that mean that to force an upload to only pass one record at a time I could just set this property to 1 - then as a row will never be a single byte, it will default to "a row" regardless of how wide the row actually is?

Finally, does a similar facility now exist for downloading data to a device?

Sorry for lots of questions! If my assumptions about use are correct - this is a really useful feature :-)

Marcus.

tsupartono
Posts: 289
Joined: Wed Apr 18, 2012 10:21 am

Re: [RDMLX]What if network connection lost during uploading

Post by tsupartono » Tue Aug 08, 2017 9:24 pm

Hi Marcus,
Unfortunately it doesn't work that way.
Your program does need to manually handle the chunks.

Post Reply