cancel
Showing results for 
Search instead for 
Did you mean: 

Native Android Offline App - Flush is failing

HemendraS
Participant
0 Kudos

Dear Experts,

We have developed "Native Android Online/Offline App", in SMP3.0 SP09 PL04 Server. The Online is working fine (CRUD), also in Offline "Read" is populating all the data sets correctly, as showing in Online, but for the "Create/Update" it (Offline) is failing. So this shows that "Offline Store" is creating, "Refresh" is also working correctly, but "Flush" is leading to exception. The debug output of "Offline Flush" is as follows:

AgencyOfflineErrorListener::offlineStoreRequestFailed()::offlineStoreRequestFailed()

offlineStoreRequestFailed------com.sap.smp.client.odata.exception.ODataNetworkException: Unknown network response error occured

I followed the template suggested by Claudia Pacheco's blog to develop this app:

  


After looking at various threads, it looks like that I need to pass few more parameters... i.e.

options.extraStreamParms = "custom_header=Authorization:Basic " + ";custom_header=X-SMP-APPCID:" +  Globales.getappCID() + ";";

options.customHeaders.put("X-SMP-APPCID", appConnID);


However, I did the changes suggested above, but still getting the same error. Probably I am missing something. Could anyone of you guide to resolve the problem or suggest the correct ways to pass "extraStreaParms".

However the in SMP Cockpit details are as follows:

I really appreciate your help.

Thanks,


Warm Regards

Hemendra

  

Accepted Solutions (1)

Accepted Solutions (1)

claudiapacheco
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Hemendra,


In the SMP Management Cockpit, go to Logs -> settings and set the offline settings to path. Try to flush the data again. Then, go to Logs and check if there's more information about the error.


Best regards,

Claudia

HemendraS
Participant
0 Kudos

Hi

We replicated the same client environment in our local landscape. We are able to perform all CRUD operations successfully but still struggling in client environment. The only difference we see at the data level (Rest all the SMP settings are similar) i.e. in our local landscape, we hardly have 500 entries, but for client this is around 38000 entries (because this is duplicate of "Production").

So in the client environment the Online is correctly fetching (i.e. showing around 145 entries, because this is user based filtered data set), but for offline this is limiting to 6 entries only. After debugging, I found that even in Online, if I look at the count for "Executor Method for Reading an Entity Set" (store.executeReadEntitySet), shows the the 1000 entries for complete entity set (As I removed the filter for user based data, which is above fetching 145), while this should be 38000 (because this collection has 38000 entries). So it looks like that in Offline this always fetch the user specific entries from this 1000 data set instead of 38000 record set. Is there any setting in SMP which is restricting this collection entries? Which is restricting the "Request Payload", and allowing default holds 1000 records at a time.

However in Offline, I have also set the filter for user specific data in "addDefiningRequest", so it should have around 145 entries, but for this it is fetching 6 entries, because this is referring to 1000 in the entity set, instead of 38000.

As suggested, please also find log file details fetched from SMP Server for your considerations:

2016 01 05 12:11:26#+0530#ERROR#com.sap.odata.offline.util.NativeLogger###Thread-252####4599e27a-1cf4-46c1-a6ba-000000000000####<16> [-10279] Connection was dropped due to lack of network activity |

2016 01 05 12:15:24#+0530#WARN#com.sybase.security.integration.tomcat7.CSIRealm###http-bio-8080-exec-10####430da0f4-166e-4801-8ad7-7d9ce8d10fc8#RequestResponse###No configuration could be found that met the conditions specified by the supplied selectors. com.sybase.security.SecException: No configuration could be found that met the conditions specified by the supplied selectors.

Thanks,

Warm Regards

Hemendra

HemendraS
Participant
0 Kudos

Thanks Marvin Hoffmann for your guidance.

It is restricting because default with Integration Gateway is picking 1000 records (for performance reasons). One has to do the custom code in JavaScript or Groovy to overwrite this behavior either by setting the header MAX_RECORDS when requesting the data or by using custom coding:

message.setHeader(ODataCamelExchangeHeaders.MAX_RECORDS.toString(), 2000);

Warm Regards

Hemendra

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Hemendra,

I am facing the same problem.

Can you please tell me where I need to change this setting?

Best Regards,

Saleem

HemendraS
Participant
0 Kudos

Hi Saleem,

You have to do the custom coding (Groovy coding) in Integration Gateway. Kindly search for custom code in Integration Gateway on SCN, you will get many useful blogs which will help you to write your code.

Thanks,

Warm Regards

Hemendra

Former Member
0 Kudos

Hi Hemendra,

Thanks 🙂

Regards,

Saleem

Former Member
0 Kudos

Hi Hemandra,

Could you please also tell the version of the SMP SDK?

Have you tried to use the latest one to have a test?

Best Regards,

Charlie

SAP Product Support

HemendraS
Participant
0 Kudos

Thanks Chalie,

This is SMP3.0 SP09 PL04. However, I saw the SMP3.0 SP10 as well in Market Place.

Thanks,

Warm Regards

Hemendra

Former Member
0 Kudos

Hi Hemendra,

It is better that you can have a test with the latest version as there should be some fixes in it.

Then if the issue can't be solved, we can do some further analysis by using the latest log file.

Best Regards,
Charlie