Skip to Content
avatar image
Former Member

Modify of items in child structure is not working

Hello,

I wrote a method witch allows to modify an item value in child structure (see at the end of this posting). The method seems to work fine. If i read the corresponding SyncBo instance again after modifying, it shows the item with the modified value and during the next synchronization it calls the modify bapi wrapper. But if I read the transfered value of the item I modified in backend, I get the inital value of this item. So the item value in backend will not be updated. The next time I synchronize I get following exceptions in trace file:

[20060411 15:26:07:426] W [AppLog/MI/Sync ] Exception while proccessing method SMARTSYNC

com.sap.ip.me.smartsync.sync.InboundTransformException: java.lang.NullPointerException

at com.sap.ip.me.smartsync.sync.SyncPackageManager.process(SyncPackageManager.java:262)

at com.sap.ip.me.smartsync.core.SmartSyncRuntimeImp.process(SmartSyncRuntimeImp.java:275)

at com.sap.ip.me.smartsync.core.SmartSyncRuntimeManager.process(SmartSyncRuntimeManager.java:167)

at com.sap.ip.me.sync.SyncManagerImplNewProtocol.processContainersInOrderForConvId(SyncManagerImplNewProtocol.java:455)

at com.sap.ip.me.sync.SyncManagerImplNewProtocol.processInOrder(SyncManagerImplNewProtocol.java:520)

at com.sap.ip.me.sync.SyncManagerImplNewProtocol.processInboundContainers(SyncManagerImplNewProtocol.java:325)

at com.sap.ip.me.sync.SyncManagerImplNewProtocol.processSyncCycle(SyncManagerImplNewProtocol.java:155)

at com.sap.ip.me.sync.SyncManagerImpl.syncForUser(SyncManagerImpl.java:909)

at com.sap.ip.me.sync.SyncManagerImpl.processSynchronization(SyncManagerImpl.java:462)

at com.sap.ip.me.sync.SyncManagerImpl.synchronizeWithBackend(SyncManagerImpl.java:274)

at com.sap.ip.me.sync.SyncManagerImpl.synchronizeWithBackend(SyncManagerImpl.java:191)

at com.sap.ip.me.api.sync.SyncManager.synchronizeWithBackend(SyncManager.java:71)

at com.sap.ip.me.apps.jsp.Home$SyncRunnable.run(Home.java:443)

at java.lang.Thread.run(Unknown Source)

java.lang.NullPointerException

at com.sap.ip.me.smartsync.data.RowFactory.updateInDelta(RowFactory.java:132)

at com.sap.ip.me.smartsync.data.SyncBoImpl.modifyFromInDelta(SyncBoImpl.java:157)

at com.sap.ip.me.smartsync.data.MessageManagerImpl.handleModifyDownload(MessageManagerImpl.java:342)

at com.sap.ip.me.smartsync.data.MessageManagerImpl.handleDeltaDownload(MessageManagerImpl.java:405)

at com.sap.ip.me.smartsync.sync.SyncPackageManager.process(SyncPackageManager.java:242)

at com.sap.ip.me.smartsync.core.SmartSyncRuntimeImp.process(SmartSyncRuntimeImp.java:275)

at com.sap.ip.me.smartsync.core.SmartSyncRuntimeManager.process(SmartSyncRuntimeManager.java:167)

at com.sap.ip.me.sync.SyncManagerImplNewProtocol.processContainersInOrderForConvId(SyncManagerImplNewProtocol.java:455)

at com.sap.ip.me.sync.SyncManagerImplNewProtocol.processInOrder(SyncManagerImplNewProtocol.java:520)

at com.sap.ip.me.sync.SyncManagerImplNewProtocol.processInboundContainers(SyncManagerImplNewProtocol.java:325)

at com.sap.ip.me.sync.SyncManagerImplNewProtocol.processSyncCycle(SyncManagerImplNewProtocol.java:155)

at com.sap.ip.me.sync.SyncManagerImpl.syncForUser(SyncManagerImpl.java:909)

at com.sap.ip.me.sync.SyncManagerImpl.processSynchronization(SyncManagerImpl.java:462)

at com.sap.ip.me.sync.SyncManagerImpl.synchronizeWithBackend(SyncManagerImpl.java:274)

at com.sap.ip.me.sync.SyncManagerImpl.synchronizeWithBackend(SyncManagerImpl.java:191)

at com.sap.ip.me.api.sync.SyncManager.synchronizeWithBackend(SyncManager.java:71)

at com.sap.ip.me.apps.jsp.Home$SyncRunnable.run(Home.java:443)

at java.lang.Thread.run(Unknown Source)

[20060411 15:26:07:426] E [AppLog/MI/Sync ] inbound processing for conversation id B9447204C1292B429BE95CB11E418B23 / B9447204C1292B429BE95CB11E418B23 stopped, because some containers could not be processed

[20060411 15:26:07:441] W [AppLog/MI/Sync ] Exception while proccessing method SMARTSYNC

com.sap.ip.me.smartsync.sync.InboundTransformException: java.lang.NullPointerException

at com.sap.ip.me.smartsync.sync.SyncPackageManager.process(SyncPackageManager.java:262)

at com.sap.ip.me.smartsync.core.SmartSyncRuntimeImp.process(SmartSyncRuntimeImp.java:275)

at com.sap.ip.me.smartsync.core.SmartSyncRuntimeManager.process(SmartSyncRuntimeManager.java:167)

at com.sap.ip.me.sync.SyncManagerImplNewProtocol.processContainersInOrderForConvId(SyncManagerImplNewProtocol.java:455)

at com.sap.ip.me.sync.SyncManagerImplNewProtocol.processInOrder(SyncManagerImplNewProtocol.java:520)

at com.sap.ip.me.sync.SyncManagerImplNewProtocol.processInboundContainers(SyncManagerImplNewProtocol.java:325)

at com.sap.ip.me.sync.SyncManagerImplNewProtocol.processSyncCycle(SyncManagerImplNewProtocol.java:155)

at com.sap.ip.me.sync.SyncManagerImpl.syncForUser(SyncManagerImpl.java:909)

at com.sap.ip.me.sync.SyncManagerImpl.processSynchronization(SyncManagerImpl.java:462)

at com.sap.ip.me.sync.SyncManagerImpl.synchronizeWithBackend(SyncManagerImpl.java:274)

at com.sap.ip.me.sync.SyncManagerImpl.synchronizeWithBackend(SyncManagerImpl.java:191)

at com.sap.ip.me.api.sync.SyncManager.synchronizeWithBackend(SyncManager.java:71)

at com.sap.ip.me.apps.jsp.Home$SyncRunnable.run(Home.java:443)

at java.lang.Thread.run(Unknown Source)

java.lang.NullPointerException

at com.sap.ip.me.smartsync.data.RowFactory.updateInDelta(RowFactory.java:132)

at com.sap.ip.me.smartsync.data.SyncBoImpl.modifyFromInDelta(SyncBoImpl.java:157)

at com.sap.ip.me.smartsync.data.MessageManagerImpl.handleModifyDownload(MessageManagerImpl.java:342)

at com.sap.ip.me.smartsync.data.MessageManagerImpl.handleDeltaDownload(MessageManagerImpl.java:405)

at com.sap.ip.me.smartsync.sync.SyncPackageManager.process(SyncPackageManager.java:242)

at com.sap.ip.me.smartsync.core.SmartSyncRuntimeImp.process(SmartSyncRuntimeImp.java:275)

at com.sap.ip.me.smartsync.core.SmartSyncRuntimeManager.process(SmartSyncRuntimeManager.java:167)

at com.sap.ip.me.sync.SyncManagerImplNewProtocol.processContainersInOrderForConvId(SyncManagerImplNewProtocol.java:455)

at com.sap.ip.me.sync.SyncManagerImplNewProtocol.processInOrder(SyncManagerImplNewProtocol.java:520)

at com.sap.ip.me.sync.SyncManagerImplNewProtocol.processInboundContainers(SyncManagerImplNewProtocol.java:325)

at com.sap.ip.me.sync.SyncManagerImplNewProtocol.processSyncCycle(SyncManagerImplNewProtocol.java:155)

at com.sap.ip.me.sync.SyncManagerImpl.syncForUser(SyncManagerImpl.java:909)

at com.sap.ip.me.sync.SyncManagerImpl.processSynchronization(SyncManagerImpl.java:462)

at com.sap.ip.me.sync.SyncManagerImpl.synchronizeWithBackend(SyncManagerImpl.java:274)

at com.sap.ip.me.sync.SyncManagerImpl.synchronizeWithBackend(SyncManagerImpl.java:191)

at com.sap.ip.me.api.sync.SyncManager.synchronizeWithBackend(SyncManager.java:71)

at com.sap.ip.me.apps.jsp.Home$SyncRunnable.run(Home.java:443)

at java.lang.Thread.run(Unknown Source)

[20060411 15:26:07:441] E [AppLog/MI/Sync ] inbound processing for conversation id B9447204C1292B429BE95CB11E418B23 / B9447204C1292B429BE95CB11E418B23 stopped, because some containers could not be processed

It seems like the framework tries to update a row via "RowFactory.updateInDelta" but i fails?!

Does anybody has a hint why the value in backend is not updated correctly?

Regards,

Andreas

public void setFieldItem(String SyncBo, String syncKey, String Row, String Field, 
String rowKey, String value)
throws SmartSyncException, PersistenceException{
		
SmartSyncTransactionManager transactionManager;
transactionManager = dataFacade.getSmartSyncTransactionManager();
transactionManager.beginTransaction();
SyncBo sb = getSyncBoInstance(SyncBo, syncKey);
SyncBoDescriptor sbd = sb.getSyncBoDescriptor();
RowDescriptor rd = sbd.getRowDescriptor(Row);
FieldDescriptor fd = rd.getFieldDescriptor(Field);
BasisFieldType bft = fd.getFieldType();
			
try {
  Row item = dataFacade.getRow(rd,rowKey);
  if (bft == BasisFieldType.C){
    CharacterField cf = item.getCharacterField(fd);
    cf.setValue(value);
    transactionManager.commit();
  }
  if (bft == BasisFieldType.P){
    DecimalField df = item.getDecimalField(fd);
    BigDecimal bd = new BigDecimal(value.toString());
    df.setValue(bd);
    transactionManager.commit();
  }
}catch (PersistenceException e){
  System.out.println(e);
}catch (SmartSyncException ex) {
  System.out.println(ex.getMessage());
}
}

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Apr 11, 2006 at 03:50 PM

    hello andreas,

    first, could you tell us the version & patch level you are

    using?

    second, in your code, the commit transaction is located within

    the if scope. you will leave the transaction open in cases

    when the types are not BasisFieldType.C or BasisFieldType.P.

    lastly, could you post the data that is in the outbound worklist

    which had caused the exception in the client? or if you have

    the data dump in the trace file, much better.

    regards

    jo

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      hello andreas,

      if you can use higher SP level the better. but you have to

      upgrade your MW as well.

      for SP9 specific notes, please refer to 761419.

      regards

      jo