DataStore in flex

末鹿安然 提交于 2019-12-25 10:50:31

问题


I am having problems in my program... Please advice me of what is right

this is the error code of my prog

mx.data::Conflict {
  cause = mx.data.messages::DataMessage {
    body = [["lessonid"],
    {
      lessonid = 17
      lessonplanid = 1
      status = "active"
      studentid = 4
    },
    valueObjects::Lessonplan {
      lessonid = 18
      lessonplanid = 1
      status = "active"
      studentid = 4
    }]
    clientId = null
    correlationId = ""
    destination = "lessonplanRPCDataManager"
    headers = {
      newReferencedIds = null
      prevReferencedIds = null
    }
    identity = {
      lessonplanid = 1
    }
    messageId = "28DEF63D-9002-787E-188A-67DFD27407F8"
    operation = 3
    timestamp = 0
    timeToLive = 0
  }
  causedByLocalCommit = false
  clientObject = valueObjects::Lessonplan {
    lessonid = 18
    lessonplanid = 1
    status = "active"
    studentid = 4
  }
  destination = "lessonplanRPCDataManager"
  errorID = 0
  message = "Local item has changes to properties that conflict with remote change."
  name = "Error"
  originalObject = {
    lessonid = 17
    lessonplanid = 1
    status = "active"
    studentid = 4
  }
  propertyNames = ["lessonid"]
  resolved = false
  serverObject = lessonplanid=1
  serverObjectDeleted = false
  serverObjectReferencedIds = {
  }
}
    at mx.data::DataStore/http://www.adobe.com/2006/flex/mx/internal::processConflict()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\DataStore.as:3428]
    at mx.data::ConcreteDataService/http://www.adobe.com/2006/flex/mx/internal::updateCache()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\ConcreteDataService.as:5468]
    at mx.data::ConcreteDataService/http://www.adobe.com/2006/flex/mx/internal::updateCacheWithId()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\ConcreteDataService.as:5316]
    at mx.data::DataList/http://www.adobe.com/2006/flex/mx/internal::processSequence()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\DataList.as:2582]
    at mx.data::DataList/http://www.adobe.com/2006/flex/mx/internal::processSequenceResult()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\DataList.as:2880]
    at mx.data::DataListRequestResponder/result()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\DataListRequestResponder.as:132]
    at mx.data::RPCDataServiceAdapter/sendResultEvent()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\RPCDataServiceAdapter.as:1508]
    at mx.data::RPCDataServiceAdapter/executeQueryResult()[C:\depot\DataServices\branches\lcds_modeler101\frameworks\projects\data\src\mx\data\RPCDataServiceAdapter.as:1444]
    at mx.collections::ItemResponder/result()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\collections\ItemResponder.as:129]
    at mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/internal::applyResult()[E:\dev\4.0.0\frameworks\projects\rpc\src\mx\rpc\AsyncToken.as:239]
    at mx.rpc.events::ResultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders()[E:\dev\4.0.0\frameworks\projects\rpc\src\mx\rpc\events\ResultEvent.as:207]
    at mx.rpc::AbstractOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[E:\dev\4.0.0\frameworks\projects\rpc\src\mx\rpc\AbstractOperation.as:244]
    at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[E:\dev\4.0.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:318]
    at mx.rpc::Responder/result()[E:\dev\4.0.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:56]
    at mx.rpc::AsyncRequest/acknowledge()[E:\dev\4.0.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:84]
    at NetConnectionMessageResponder/resultHandler()[E:\dev\4.0.0\frameworks\projects\rpc\src\mx\messaging\channels\NetConnectionChannel.as:547]
    at mx.messaging::MessageResponder/result()[E:\dev\4.0.0\frameworks\projects\rpc\src\mx\messaging\MessageResponder.as:235]

回答1:


The Flex documentation says, an error of type conflict is

Dispatched when a conflict is detected between either pending changes on this client and changes submitted by another client, or when changes submitted by this client result detect a conflict error at the remote destination.

You will have to figure the solution out yourself (it is not something caused by Flex, but by the data you want to commit).

Local item has changes to properties that conflict with remote change.

sounds to me like you have some kind of verification failure, because

clientObject = valueObjects::Lessonplan {
    lessonid = 18
    lessonplanid = 1
    status = "active"
    studentid = 4   }

and

originalObject = {
    lessonid = 17
    lessonplanid = 1
    status = "active"
    studentid = 4
  }

are incompatible. I suppose changing the lessionid is not allowed.



来源:https://stackoverflow.com/questions/5134236/datastore-in-flex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!