Skip to Content
author's profile photo Former Member
Former Member

Error on Syncronize

<b>Hi all,</b>

An error is happening in my application. my net is unstable and nor always I obtain to complete to the synchronization. When I sending one solicitation and happens error, suggests the user to restart the process again. What it happens is that when it executes and complete the transaction, the MI submits 2 times to r/3.

<b>att.,

Douglas</b>

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    Posted on Jun 11, 2007 at 05:08 PM

    I see. Unfortunately, that is not possible. Once you created a generic sync container and put it into the outbound queue, you can't delete it afterwards. It's like putting a letter into the mailbox, once you put it in, there is no way to get it out - unless you break the mailbox ;-

    You can avoid sending multiple containers with the code provided, but you cannot get rid of the already submitted ones and only sent the lastone.

    sorry and cheers

    stefan

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 11, 2007 at 02:10 PM

    Hi,

    if this code is called everytime the uses presses "sync", then you will see the behaviour you described. So it would be good to know from where this method is called. Anyhow, you could use this method www.sdn.sap.com/irj/go/km/docs/library/mobile/mobile%20infrastructure/mobile%20development%20kit%202.5/content/javadoc/com/sap/ip/me/api/sync/inboundprocessorregistry.html#isalreadyinoutboundqueue(java.lang.String, com.sap.ip.me.api.conf.Visibilit">isAlreadyInOutboundQueue to avoid creating containers over and over for your app if there are still pending containers.

    cheers

    stefan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 11, 2007 at 03:44 AM

    Hi Douglas,

    If a sync is broken in between, then MI will try to resend the information again the next time you try. The protocols between the MI client and middleware ensures that the same data is not used for two updates.

    Can you please set the trace level to 'ALL' and send us the exception you see in the trace file.

    Thanks and Best Regards,

    Sandeep

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 11, 2007 at 04:31 PM

    Sorry, I guess we misunderstand each other. With my additonal if statement, you DO create a container in case there is no old one pending. If there is an old container which has not been answered yet, your code will not create an additional container to avoid that the backedn is queried twice for the exacts same data.

    cheers

    stefan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 11, 2007 at 08:32 AM

    Hi Douglas,

    As sandeep said, MI sends the delta data from last synchronization, this concept is called as delta Synchronization. If you sync it once and lose the connection, and sync back for the subsequent connection, the delta data will get loaded to backend.

    once restart your client.

    can you look into MEREP_MON for the errors?

    Divya

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 11, 2007 at 01:01 PM

    Hi,

    could it be that your applicatio ncode creates a generic sync container everytime the synchronisation is triggered by the user ? This would explain why, everytime you have a failed sync, an additional conatiner is created.

    cheers

    stefan

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      My source code is:

      public String confirmaRecebimento(ZrecCreateBean bean)
      		throws SofttekException {
      
      		try {
      
      			OutboundContainerFactory outfactory =
      				OutboundContainerFactory.getInstance();
      
      			if (outfactory != null) {
      
      				OutboundContainer out =
      					outfactory.createOutboundContainer(
      						VisibilityType.SEPARATED,
      						Z_MDK_REC_CREATE,
      						OutboundContainer.TYPE_REQUEST);
      
      					for(int i=0;i<bean.size();i++) {
      					ZrecCreateBean objBean = new ZrecCreateBean();
      					objBean = bean.getCurrent();
      					out.addItem(
      						"TI_RET",
      						objBean.getZ_LGNUM()
      							+ objBean.getZ_MATNR()
      							+ objBean.getZ_BWLVS()
      							+ StringFormat.InsertSpaceEnd(
      								objBean.getZ_CHARG(),
      								10)
      							+ StringFormat.InsertSpaceEnd(
      								objBean.getZ_VLPLA(),
      								10)
      							+ StringFormat.InsertSpaceEsq(
      								objBean.getZ_VLTYP(),
      								3)
      							+ StringFormat.InsertSpaceEnd(
      								objBean.getZ_NLPLA(),
      								10)
      							+ StringFormat.InsertSpaceEsq(
      								objBean.getZ_NLTYP(),
      								3)
      							+ StringFormat.InsertSpaceEsq(
      								objBean.getZ_LGPLA(),
      								10)
      							+ StringFormat.InsertSpaceEsq(
      								objBean.getZ_LGTYP(),
      								3)
      							+ StringFormat.InsertSpaceEsq(
      								objBean.getZ_LGORT(),
      								4)
      							+ StringFormat.InsertSpaceEsq(
      								objBean.getZ_WERKS(),
      								4)
      							+ StringFormat.InsertSpaceEsq(
      								objBean.getZ_ANFME(),
      								10)
      							+ objBean.getZ_ZALTME());
      					bean.getNext();
      				}
      				out.close();
      				ZMOB_WRP_REC_CREATE.reset();
      				SyncManager sm = SyncManager.getInstance();
      				
      				sm.synchronizeWithBackend();
      				
      			}
      
      		} catch (IllegalArgumentException e) {
      
      			aLogger.log(
      				Severities.ERROR,
      				"IllegalArgumentException: " + e.getMessage());
      			throw new SofttekException(e.getMessage());
      
      		} catch (SyncException e) {
      
      			aLogger.log(Severities.ERROR, "SyncException: " + e.getMessage());
      			throw new SofttekException(e.getMessage());
      
      		}
      
      		//verifica resposta do r/3
      		if (ZMOB_WRP_REC_CREATE.getsReturn() == "1") {
      			SofttekException ex = new SofttekException();
      			ex.addMessage(ZMOB_WRP_REC_CREATE.getMensagem());
      			throw ex;
      		}
      		//verifica se chegou mensagem de erro
      		if (ZMOB_WRP_REC_CREATE.getMensagem() != null
      			&& ZMOB_WRP_REC_CREATE.getMensagem() != "") {
      			SofttekException ex = new SofttekException();
      			ex.addMessage(ZMOB_WRP_REC_CREATE.getMensagem());
      			throw ex;
      		} else {
      			//PROCESSAMENTO NAO CONCRETIZADO
      			
      			//ponto container de dados não lido por falta de comunicação
      			return ERRO_DADONAOLIDO;
      		}
      	}
      

  • Posted on Jun 11, 2007 at 02:24 PM

    Hi,

    if your method "confirmaRecebimento" is called everytime the user starts a synchronization,then you should do the following:

    Add a new if-statement before you create the new container, like this:

    if(!InboundProcessorRegistry.isAlreadyInOutboundQueue(Z_MDK_REC_CREATE) {return;}

    This way, you only create a new sync container to be sent to the backend if the previous one has not yet been acknowledged.

    cheers

    stefan

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.