Select to view content in your preferred language

How can I perform multiple operations in a single applyEdits?

1390
6
04-24-2017 04:27 AM
Krishna_ChaitanyaGanjam
Emerging Contributor

I want to perform update and delete operation in a single applyEdits() call from my android application, my code is as below:

Thread.sleep(300);
layer.applyEdits(null, deletes, updates, new CallbackListener<FeatureEditResult[][]>() { ... });

I am able to perform the desired operation only before applying a certain sleep interval, if not, the deletes array gets passed as empty, and therefore, the delete and update operations does not take place in a single transaction.

Please provide your inputs.




0 Kudos
6 Replies
AlexanderNohe1
Honored Contributor

Which version of the runtime are you working with?

0 Kudos
Krishna_ChaitanyaGanjam
Emerging Contributor

it is :

com.esri.arcgis.android:arcgis-android:10.2.6-2
0 Kudos
AlexanderNohe1
Honored Contributor

I would recommend updating to the latest 10.2.9 runtime as this has many security and vulnerability fixes included with it.

Are you perhaps updating the array asynchronously and not waiting for the update operation to finish before calling applyEdits()?

Thanks,

Alexander

0 Kudos
Krishna_ChaitanyaGanjam
Emerging Contributor

Even after updating to the latest version (10.2.9), the problem persists.

I am not performing any asynchronous operation before calling applyEdits(). My 'updates' and 'deletes' arrays are formed completely before passing it to the applyEdits().

I still wonder as to which of the 'update' operation you are referring to?

0 Kudos
AlexanderNohe1
Honored Contributor

Update operation was whatever you are doing to update the arrays.  How many items are you trying to delete at once?  What is the last call that you do before calling apply edits?

0 Kudos
Krishna_ChaitanyaGanjam
Emerging Contributor

I am simply populating the update and delete arrays using two local methods which doesn't include any async call. It is using the locally stored Hashmap which has details of the graphics that I need to update/delete. There are almost 2-3 object id's that I am passing for deletion.

Moreover, I verified (performing debugging) that the updates and deletes arrays are having sufficient (or correct) data needed for a successful applyEdits operation. Also, the applyEdits works fine, but with a significant amount of delay which is what I am trying to avoid.

0 Kudos