Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

LCDS fails at initializing DataStore

Avatar

Level 2

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\branches\milestone\adepds46_rc\frameworks\projects\airfds\src\mx\data\offline\EntityManager.as:393]

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

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

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

    at Function/<anonymous>()[C:\depot\DataServices\branches\milestone\adepds46_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.as:4486]

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

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

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

    at Function/<anonymous>()[C:\depot\DataServices\branches\milestone\adepds46_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\projects\rpc\src\mx\rpc\AsyncDispatcher.as:50]

    at flash.utils::Timer/_timerDispatch()

    at flash.utils::Timer/tick()

3 Replies

Avatar

Employee

Hi,

Can you ensure that you are linking in airfds.swc, and not fds.swc?

Rohit