[
https://jira.jboss.org/jira/browse/JBSEAM-1814?page=com.atlassian.jira.pl...
]
Dan Allen commented on JBSEAM-1814:
-----------------------------------
Here's what I'm inclined to do. I cannot understand why the wrapped data is set to
null. Either the field should be set to null or the data model should just be left alone.
Obviously, it makes sense to save the data model into the conversation context and
subsequently update the wrapped data, but I don't get why it is necessary to set it to
null. That just makes life difficult for the developer.
The whole idea of this interceptor is to make sure that the entity instance is loaded from
the persistence context on the other side of the replication. Basically, you want all
managed entities to stay managed after a fail-over. I think we simply take out the line
setWrappedData(dataModel, null).
Does anyone object?
DataModel wrapped data is set to null by ManagedEntityInterceptor
-----------------------------------------------------------------
Key: JBSEAM-1814
URL:
https://jira.jboss.org/jira/browse/JBSEAM-1814
Project: Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.0.0.BETA1
Environment: seam cvs (20070816.1709)
Reporter: Matt Drees
Assignee: Dan Allen
Priority: Minor
Fix For: 2.1.2.CR1
The following test fails:
@Name("dataModelComponent")
@Scope(ScopeType.CONVERSATION)
public class DataModelComponent extends EntityQuery {
@Override
public String getEjbql() {
return "from java.lang.Object o";
}
}
public class DataModelComponentTest extends SeamTest {
@Test
public void test() throws Exception {
new FacesRequest() {
@Override
protected void renderResponse() throws Exception {
DataModel model = (DataModel)
getValue("#{dataModelComponent.dataModel}");
assert model.getWrappedData() != null;
}
}.run();
}
}
Because the component is conversation-scoped, a ManagedEntityIdentityInterceptor is
attached, which nulls the wrapped List after getDataModel() is called.
In the referenced forum, Gavin indicated he hadn't decided whether this should be
expected behavior or not, and asked for a jira issue.
If it is expected behavior (I hope not), I think either EntityQuery should not have a
getDataModel() attribute, or it should be documented and/or programmatically enforced that
EntityQuerys should not be conversation-scoped.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira