Skip navigation
Currently Being Moderated

LCDS fails at initializing DataStore

Apr 6, 2012 6:55 AM

Hi,

 

we're using ADEP 4.6 Dataservices' datamanagement and we're getting a strange but explainable error. We have an AIR desktop app with a dataservice and offline cache.

 

The situation is that I commited a property value change on an item in a managed collection. Let's say:

FileDto with id: 10 and isFavorite: true.

Commit works and isFavorite is now true for this item in the backend database.

 

After that we do a synchronizeFill operation which return FileDto with id:10 as a deleted item, so LCDS automatically deletes this record from my offline cache. Again, no problems here.

 

I close my app and restart it. The first thing it wants to do when initializing my dataservice instance is initialize my datastore. This is were things go wrong.

For some reason (i'm guessing for rollbacks) the datastore has to restore the "committed and sent message batches" which has a reference to FileDto with id: 10. But obviously, when it tries to get this from the offline cache, it doesn't find it and throws a null pointer exception.

 

Why is this happening if LCDS previously got a command to delete this record? And why does it try to restore "committed and sent message batches"?

 

Any help would be appreciated.

 

ps:

 

This is the actual error thrown

 

Caught error initializing metadata for datastore: null error: TypeError: Error #1009: Cannot access a property or method of a null object reference.

    at mx.data.offline::EntityManager/getItems()[C:\depot\DataServices\branc hes\milestone\adepds46_rc\frameworks\projects\airfds\src\mx\data\offli ne\EntityManager.as:393]

    at mx.data::SQLiteOfflineAdapter/getItems()[C:\depot\DataServices\branch es\milestone\adepds46_rc\frameworks\projects\airfds\src\mx\data\SQLite OfflineAdapter.as:117]

    at mx.data::DataStore/restoreReferencedItems()[C:\depot\DataServices\bra nches\milestone\adepds46_rc\frameworks\projects\data\src\mx\data\DataS tore.as:4865]

    at mx.data::DataStore/registerItemsWithMessageCache()[C:\depot\DataServi ces\branches\milestone\adepds46_rc\frameworks\projects\data\src\mx\dat a\DataStore.as:4518]

    at Function/<anonymous>()[C:\depot\DataServices\branches\milestone\adepd s46_rc\frameworks\projects\data\src\mx\data\DataStore.as:4429]

    at mx.data::DataStore/initMessageCache()[C:\depot\DataServices\branches\ milestone\adepds46_rc\frameworks\projects\data\src\mx\data\DataStore.a s:4486]

    at Function/<anonymous>()[C:\depot\DataServices\branches\milestone\adepd s46_rc\frameworks\projects\data\src\mx\data\DataStore.as:3469]

    at Function/<anonymous>()[C:\depot\DataServices\branches\milestone\adepd s46_rc\frameworks\projects\data\src\mx\data\DataStore.as:3255]

    at mx.data::DataStore/getAllConfigCollections()[C:\depot\DataServices\br anches\milestone\adepds46_rc\frameworks\projects\data\src\mx\data\Data Store.as:3257]

    at Function/<anonymous>()[C:\depot\DataServices\branches\milestone\adepd s46_rc\frameworks\projects\data\src\mx\data\DataStore.as:3516]

    at mx.rpc::Responder/result()[E:\dev\4.x\frameworks\projects\rpc\src\mx\ rpc\Responder.as:56]

    at mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/internal::applyResult()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\AsyncToken.as:239]

    at Function/http://adobe.com/AS3/2006/builtin::apply()

    at mx.rpc::AsyncDispatcher/timerEventHandler()[E:\dev\4.x\frameworks\pro jects\rpc\src\mx\rpc\AsyncDispatcher.as:50]

    at flash.utils::Timer/_timerDispatch()

    at flash.utils::Timer/tick()

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points