Long running conversation issue
jovincen Jan 5, 2012 8:21 AMHi All.
I have a very particular issue in Seam. I don't believe it is common as I have not seen reference to it.
Objects seem to be disappearing - for no good reason.
I have a long running transaction - an editor. This editor composes objects together through various session scoped beans. One bean wraps a parent DB element. Other beans wrap various children rows. All these beans are driven from the primary editor.
When I open the editor and complete the process quickly there are no problems - everything works as expected. However when I delay my inputs (by 10 minutes or so) I experience weirdness where an @Out variable looses field values that existed previously.
The weird thing is that there are absolutely no problems if I do not delay inputs by 10 minutes.
I have also noticed the strange behaviour. I have a property #{editor.selected.text} hooked up to a rich editor. Like so:
@Stateful
@Name("editor")
public class Editor implements IEditor
{
private MyItem contrib;
@In
private ICache cache;
public void Init()
{
cache.selectSomething();
contrib = cache.getSelected();
}
...
public MyItem getSelected()
{
return cache.getSelected();
}
public void done()
{
cache.done();
}
}
<rich:editor ... value = "#{editor.getSelected}" />
...
Now you can see that I keep a local reference to the variable in the second cache bean. When I complete the process quickly (call done early) both contrib and cache.getSelected() refer to the same object - the values posted by rich:editor appear in both.
If I delay the post by 10 minutes (leave the machine when the rich:editor is displaying) When done is called then contrib and cache.getSelected() refer to separate objects. The value is posted to the cache.getSelected() only.
My thoughts are that this has something to do with serialisation - beans should not directly reference objects owned by other beans (or hold them as copies only). However this would not explain the issue I am having with the @Out variable.
I'm running:
jboss-6.1.0.Final
jboss-seam-2.2.2.Final
I would really appreciate some suggestions!
Cheers,
Jon