[
https://issues.apache.org/jira/browse/WICKET-6334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15899667#comment-15899667
]
Ihor Parashynets commented on WICKET-6334:
------------------------------------------
{quote}
I applaud your curiousity: models are for components, they are single threaded
(as are components) and thus have nothing to do within a Session.
{quote}
_Thank you for your applauding by the way..._
I understood that this model is being shared between different threads and so
on so forth. My point was that if LDM is in "read only mode" - would it harm
the current use case? I mean a use case when LDM model reads some immutable
info.
And again the overall issue - I can see that {{WicketObjects#sizeof(final
Serializable object)}}, which is used for defining Wicket session size, is
actually expecting that there might be objects which are implementing
{{IDetachable}}
{code:java}
else if (object instanceof IDetachable)
{
// clone to not detach the original IDetachable
(WICKET-5013, 5014)
IDetachable clone = (IDetachable) cloneObject(object);
clone.detach();
target = clone;
}
{code}
in parallel with {{NotDetachedModelChecker}}, which does the check on this
session serialization stack:
{code:java}
@Override
public Result doCheck(Object obj)
{
Result result = Result.SUCCESS;
if (obj instanceof LoadableDetachableModel<?>)
{
LoadableDetachableModel<?> model =
(LoadableDetachableModel<?>) obj;
if (model.isAttached())
{
result = new Result(Result.Status.FAILURE, "Not
detached model found!");
}
}
return result;
}
{code}
verifies this non-detached state and issues a failure, which is a little bit
misleading... because even if there are some issues with concurrency, bad
design, whatever... with this error message in the log, it says that there is
not-detached model in the session, which is not true actually.
If you think that this is not valid use-case and Mr. [~mgrigorov] doesn't have
additional reasons to fix the "issue" - I give up here.
Thank you for your responses...
> WicketObjects#sizeof() should detach Sessions
> ---------------------------------------------
>
> Key: WICKET-6334
> URL: https://issues.apache.org/jira/browse/WICKET-6334
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 7.6.0
> Reporter: Martin Grigorov
> Assignee: Martin Grigorov
> Priority: Minor
>
> Report at users@ : http://markmail.org/message/mq5zs2veaj4q4psg
> Wicket should detach the Session before calculating its size as it does for
> Component and IDetachable.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)