Grokbase Groups Cayenne dev May 2006
FAQ
It doesn't look like child DataContexts properly restore from serialization.
They end up in a state without an EntityResolver because channel is
non-null and lazyInitParentDomainName is null.

Before serialization:
===========================
channel= DataContext (id=4110)
entityResolver= EntityResolver (id=89)
lazyInitParentDomainName= null
mergeHandler= DataContextMergeHandler (id=4111)
objectStore= ObjectStore (id=4112)
===========================

After serialization:
===========================
channel= DataContext (id=4162)
entityResolver= null
lazyInitParentDomainName= null
mergeHandler= null
objectStore= ObjectStore (id=4163)
===========================

public EntityResolver getEntityResolver() {
awakeFromDeserialization();
return entityResolver;
}

// Re-attaches itself to the parent domain with previously stored name.
//
// TODO: Andrus 11/7/2005 - this is one of the places where Cayenne
// serialization relies on shared config... This is bad. We need some
// sort of thread-local solution that would allow to use an
alternative configuration.
//
private final void awakeFromDeserialization() {
if (channel == null && lazyInitParentDomainName != null) {

// call a setter to ensure EntityResolver is extracted from channel
setChannel(Configuration.getSharedConfiguration().getDomain(
lazyInitParentDomainName));
}
}

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedMay 22, '06 at 11:08p
activeMay 22, '06 at 11:08p
posts1
users1
websitecayenne.apache.org

1 user in discussion

Mike Kienenberger: 1 post

People

Translate

site design / logo © 2022 Grokbase