This discussion is archived
7 Replies Latest reply: Jan 10, 2013 1:57 PM by cpierres RSS

TableBean in pageFlowScope with transient member on RichTable

cpierres Newbie
Currently Being Moderated
Hello Stevan,

On this excellent new book :
http://jobinesh.blogspot.com/2012/10/oracle-adf-real-world-developers-guide.html

I've read one information that surprises me about the last point of page 536 :
"You should not use transient member variables in a managed bean with a scope higher than the request, to hold UI component reference. This hard reference will prevent the UI component tree from being cleaned up."
I’m not sure to understand this sentence.
Actually, I noticed that, in generated application, a TableBean was by default in pageFlowScope with a transient member on RichTable. Is it a correct practice or not ?

Thanks you very much,
  • 1. Re: TableBean in pageFlowScope with transient member on RichTable
    Steven Davelaar Employee ACE
    Currently Being Moderated
    Yes, we are aware of that, while we knew it was not recommended, this code is there for many years and it is working smoothly (no memory issues encountered).
    At the time we wrote the code, the ComponentReference was not working correctly yet.

    Jobinesh is the first to mention a real reason why marking it transient is not a good solution.

    However, his solution on using the ComponentReference is under debate as well, see this older post from Bake Sullivan:

    http://leadingyouastray.blogspot.nl/2010/02/references-to-uicomponents-in-session.html

    Blake writes "The bigger problem is that this solution is still kind of lame"

    Duncan blogged on another pattern to solve this issue:
    https://blogs.oracle.com/groundside/entry/the_uimanager_pattern

    We will check with Duncan, Blake and Jobinesh, and then decide on the best technique to implement with the next JHeadstart release.

    Steven Davelaar,
    JHeadstart Team.
  • 2. Re: TableBean in pageFlowScope with transient member on RichTable
    cpierres Newbie
    Currently Being Moderated
    Steven,

    Thanks you very much for your answer.
    We are JHeadstart customers since 4-5 years (Government of New-Caledonia - a french island) ; We gained precious time gracefully to your solution. We don't use the generator but only some parts of runtime (generator of good ideas !).
    We developped more than 50 applications with ADF (10g and 11g) ; until now we didn't need for clustered application server.
    But next, we have a very big application (potentially 10 000 users) and we must be very attentive for cluster matters.

    If you have more ideas before the next release of JHeadstart, we are interested !

    Thanks a lot,

    Christophe,
  • 3. Re: TableBean in pageFlowScope with transient member on RichTable
    Steven Davelaar Employee ACE
    Currently Being Moderated
    Christophe,

    Gooed to hear you like JHeadstart, indeed there is a lot of useful stuff in the rumtime!

    I checked internally.
    This is the outcome (I will blog about it as well):
    - Always use ComponentReference, even in request-scoped and backingBean-scoped beans.
    - There is no need to refactor into beans with smaller scopes, unless you are using a component in a session-scoped bean. Only in session beans the Component reference is still not safe.

    The next version of Jheadstart will implement these guidelines.

    Steven Davelaar,
    JHeadstart team.
  • 4. Re: TableBean in pageFlowScope with transient member on RichTable
    cpierres Newbie
    Currently Being Moderated
    Steven,

    Thanks a lot for this precious information !

    Christophe,
  • 5. Re: TableBean in pageFlowScope with transient member on RichTable
    cpierres Newbie
    Currently Being Moderated
    Hi Steven,

    I've read your excellent post about my remark on :
    https://blogs.oracle.com/ATEAM_WEBCENTER/entry/rules_and_best_practices_for

    So my goal is to change our applications for this too large scope about TableBean.
    However, I have two small questions about the fact that TableBean is by default in pageFlowScope :
    1/ why this bean needed to put in pageFlowScope ? Is it correct if put in requestScope ?
    2/ among your solutions, which applied the best to TableBean ?
    3/ and last : is it possible to get a jheadstart minor release (for jdev 11.1.1.4 / 11.1.1.6) ?

    Thanks a lot,
    Christophe
  • 6. Re: TableBean in pageFlowScope with transient member on RichTable
    Steven Davelaar Employee ACE
    Currently Being Moderated
    Christophe,

    The TableBean could have been in viewScope, in requestScope it doesn't work.
    But there is no need to change the scope (requires a lot of changes!), we need to change the JHS runtime beans to use ComponentReference where applicable.

    This is planned for the next release, which is planned for Q1 of 2013.

    Steven Davelaar,
    JHeadstart Team.
  • 7. Re: TableBean in pageFlowScope with transient member on RichTable
    cpierres Newbie
    Currently Being Moderated
    Thanks a lot Steven !

    Edited by: cpierres on Jan 10, 2013 9:57 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points