cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to delete a record or modify after sync with the DOE

Former Member
0 Kudos

Hi,

I am developing an application which is generating childs from the parents as well as performing all operations on childs as well as on parent.

In my application id has to generate automatically after syncing with the DOE. (But we have to sync two times for the auto id to generate. I don't know whether two times is mandatory thing or for my application it is happenning).

The problem in my application is i created 4 records at a time in parent table and then synced for 6 or 7 times. Then the id's are generated for 3 records and the remaining one is still 0. so i tried to delete that record it is saying

{

<Exception text="An error has occurred: Failed to process the request. [] " callStack="com.sap.tc.mobile.exception.standard.SAPUnsupportedOperationException: Last change of object {1} was rejected by the server; object cannot be deleted on client until issue is resolved

at com.sap.tc.mobile.cfs.mbosync.InternalSyncState.verifyClientDelete(InternalSyncState.java:1083)

}

even for modify operation also it is saying the same exception and client getting aborted

But I am able to delete records what i have created after that record.

Note:

I am using NWDS 7.1

Please help me in solving this problem it's an urgent need

Any ideas or suggestions also welcome.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Oliver has reason... You have to see the status of the row...

For do this you can:


try {
			SyncBoDescriptor sbd = descriptorFacade.getSyncBoDescriptor(syncBoName);
			SyncBo s = dataFacade.getSyncBo(sbd, syncKey);
			if (s.getStatus().toString().equals("G") || s.getStatus().toString().equals("L")) {
				dataFacade.deleteSyncBo(dataFacade.getSyncBo(sbd, syncKey));
			}
		} catch (PersistenceException pex) {
			System.out.println(pex.getMessage());
		} catch (ModificationNotAllowedException e) {
			System.out.print(e.getMessage());
		}		

Regards,

Former Member
0 Kudos

Hi victor,

where do we need to write the code(what you have sent ) to check the status of the record

since i am new to sap world slowly i am learning so please cooperate me that 's y i am asking every step

Former Member
0 Kudos

When you need see the state of the row...

With the syncBO and the syncKey, you can see the state.

Regards,

Former Member
0 Kudos

Hi,

this code you have to write while changing the BO. Well, simple Java coding at thend. You usually read the existing instance of the BO. Then you change some settings and then you try to persists that. After you read the instance - you check the state of the BO with the lines you can see in the code. If it is not G or L, then do not change anything, cause it will result in Exception!

Regards,

Oliver

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

as long as you have not synced you can delete any BO on the client. After sync it is only possible, if backend allows delete.

If the items syncs, the stateof the item changes and so it is INSYNC. It is waiting for an answer from the backend. As long as the item is in that State, it cannot be modifid, deleted,..... Please check the state of the relevant item. If the reply is missing - check your create handlers in the backend - I guess there is aproblem then.

Hope that helps.

Regards,

Oliver

Former Member
0 Kudos

Hi Oliver,

we are using SAP Netweaver Mobile 7.1 and can you tell me what do you mean by the handlers in the backend

thanks

Naveen

Former Member
0 Kudos

Hi,

this is a feature that is the same in 7.0 and 7.1

Check the status of the BO on the client. As long as it is LOCAL you can delete it and change it as often as you like. This is the fact for all items you created later - you have not synced since you created them - so you can change or delete them.

Once you haver synced, this item goes into state INSYNC. As long as it is in this state, you can do nothing with this item - except reading it. You nedd to wait until the answer from the backend comes down to the client.

Once the answer was received from the backend you can delete or modify this item, if you have defined a MODIFY or DELETE handler in the SyncBO definition.

Hope this makes it a little more clear.

Regards,

Oliver