You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-issues@incubator.apache.org by "Arjuna Wijeyekoon (JIRA)" <ad...@incubator.apache.org> on 2006/09/29 18:46:19 UTC

[jira] Created: (ADFFACES-209) stateManagerImpl does not preserve state for UIViewRoot Correctly.

stateManagerImpl does not preserve state for UIViewRoot Correctly.
------------------------------------------------------------------

                 Key: ADFFACES-209
                 URL: http://issues.apache.org/jira/browse/ADFFACES-209
             Project: MyFaces ADF-Faces
          Issue Type: Bug
            Reporter: Arjuna Wijeyekoon


Currently, Trinidad's StateManagerImpl recreates the UIViewRoot component on every request.
This causes the following bugs:
1. not all state is copied from the old UIViewRoot to the new UIViewRoot, specifically:
 unique id counters and faces listeners, etc ...
2. If  the class for UIViewRoot component is redefined in faces-config.xml, this will break after first the first restoreState call.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (ADFFACES-209) stateManagerImpl does not preserve state for UIViewRoot Correctly.

Posted by "Arjuna Wijeyekoon (JIRA)" <ad...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/ADFFACES-209?page=all ]

Arjuna Wijeyekoon updated ADFFACES-209:
---------------------------------------

    Attachment: stateManager_viewroot_cache_issue.patch

> stateManagerImpl does not preserve state for UIViewRoot Correctly.
> ------------------------------------------------------------------
>
>                 Key: ADFFACES-209
>                 URL: http://issues.apache.org/jira/browse/ADFFACES-209
>             Project: MyFaces ADF-Faces
>          Issue Type: Bug
>            Reporter: Arjuna Wijeyekoon
>         Attachments: stateManager_viewroot_cache_issue.patch
>
>
> Currently, Trinidad's StateManagerImpl recreates the UIViewRoot component on every request.
> This causes the following bugs:
> 1. not all state is copied from the old UIViewRoot to the new UIViewRoot, specifically:
>  unique id counters and faces listeners, etc ...
> 2. If  the class for UIViewRoot component is redefined in faces-config.xml, this will break after first the first restoreState call.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (ADFFACES-209) stateManagerImpl does not preserve state for UIViewRoot Correctly.

Posted by "Arjuna Wijeyekoon (JIRA)" <ad...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/ADFFACES-209?page=all ]

Arjuna Wijeyekoon updated ADFFACES-209:
---------------------------------------

    Status: Patch Available  (was: Open)

> stateManagerImpl does not preserve state for UIViewRoot Correctly.
> ------------------------------------------------------------------
>
>                 Key: ADFFACES-209
>                 URL: http://issues.apache.org/jira/browse/ADFFACES-209
>             Project: MyFaces ADF-Faces
>          Issue Type: Bug
>            Reporter: Arjuna Wijeyekoon
>         Attachments: stateManager_viewroot_cache_issue.patch
>
>
> Currently, Trinidad's StateManagerImpl recreates the UIViewRoot component on every request.
> This causes the following bugs:
> 1. not all state is copied from the old UIViewRoot to the new UIViewRoot, specifically:
>  unique id counters and faces listeners, etc ...
> 2. If  the class for UIViewRoot component is redefined in faces-config.xml, this will break after first the first restoreState call.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (ADFFACES-209) stateManagerImpl does not preserve state for UIViewRoot Correctly.

Posted by "Arjuna Wijeyekoon (JIRA)" <ad...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/ADFFACES-209?page=comments#action_12438773 ] 
            
Arjuna Wijeyekoon commented on ADFFACES-209:
--------------------------------------------

why do we recreate the UIViewRoot component on every request?

Well, we wanted to optimize by not calling processRestoreState() when the cached UIComponent tree (from the previous request) is available.
However, when the UIViewRoot was cached, it would cause the following bug:
1. events were queued during a request.
2. because of validation errors queued events were not delivered.
3. response is rendered.
4. subsequent request comes in.
5. no validation errors are generated.
6. !!BUG!! events queued in step 1 are delivered now!

So to workaround that we decided to recreate the UIViewRoot component and not cache it. Instead, we cache the attributes from the old
UIViewRoot component and copy them onto the new one.
However, as this issue points out, we still have bugs.

> stateManagerImpl does not preserve state for UIViewRoot Correctly.
> ------------------------------------------------------------------
>
>                 Key: ADFFACES-209
>                 URL: http://issues.apache.org/jira/browse/ADFFACES-209
>             Project: MyFaces ADF-Faces
>          Issue Type: Bug
>            Reporter: Arjuna Wijeyekoon
>
> Currently, Trinidad's StateManagerImpl recreates the UIViewRoot component on every request.
> This causes the following bugs:
> 1. not all state is copied from the old UIViewRoot to the new UIViewRoot, specifically:
>  unique id counters and faces listeners, etc ...
> 2. If  the class for UIViewRoot component is redefined in faces-config.xml, this will break after first the first restoreState call.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (ADFFACES-209) stateManagerImpl does not preserve state for UIViewRoot Correctly.

Posted by "Arjuna Wijeyekoon (JIRA)" <ad...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/ADFFACES-209?page=comments#action_12438776 ] 
            
Arjuna Wijeyekoon commented on ADFFACES-209:
--------------------------------------------

Suggested solution by Adam:

1. we should cache the UIViewRoot.
2. On the subsequent request, we should call restoreState on it.  We still avoid calling processRestoreState on the tree. However, by calling restoreState on the UIViewRoot we should clear out any residual state (like stale events) from the previous request while still holding on to valid state for the new request.
3. to implement this, we need to call saveState on the UIViewRoot so that that state can be cached and used for the subsequent restoreState call.

I will test this out and upload a patch if it works.

> stateManagerImpl does not preserve state for UIViewRoot Correctly.
> ------------------------------------------------------------------
>
>                 Key: ADFFACES-209
>                 URL: http://issues.apache.org/jira/browse/ADFFACES-209
>             Project: MyFaces ADF-Faces
>          Issue Type: Bug
>            Reporter: Arjuna Wijeyekoon
>
> Currently, Trinidad's StateManagerImpl recreates the UIViewRoot component on every request.
> This causes the following bugs:
> 1. not all state is copied from the old UIViewRoot to the new UIViewRoot, specifically:
>  unique id counters and faces listeners, etc ...
> 2. If  the class for UIViewRoot component is redefined in faces-config.xml, this will break after first the first restoreState call.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (ADFFACES-209) stateManagerImpl does not preserve state for UIViewRoot Correctly.

Posted by "Matthias Weßendorf (JIRA)" <ad...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/ADFFACES-209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Weßendorf updated ADFFACES-209:
----------------------------------------

        Fix Version/s: 1.0.0-incubating-core
    Affects Version/s: 1.0.0-incubating-core

> stateManagerImpl does not preserve state for UIViewRoot Correctly.
> ------------------------------------------------------------------
>
>                 Key: ADFFACES-209
>                 URL: https://issues.apache.org/jira/browse/ADFFACES-209
>             Project: MyFaces ADF-Faces
>          Issue Type: Bug
>    Affects Versions: 1.0.0-incubating-core
>            Reporter: Arjuna Wijeyekoon
>             Fix For: 1.0.0-incubating-core
>
>         Attachments: stateManager_viewroot_cache_issue.patch
>
>
> Currently, Trinidad's StateManagerImpl recreates the UIViewRoot component on every request.
> This causes the following bugs:
> 1. not all state is copied from the old UIViewRoot to the new UIViewRoot, specifically:
>  unique id counters and faces listeners, etc ...
> 2. If  the class for UIViewRoot component is redefined in faces-config.xml, this will break after first the first restoreState call.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ADFFACES-209) stateManagerImpl does not preserve state for UIViewRoot Correctly.

Posted by "Arjuna Wijeyekoon (JIRA)" <ad...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/ADFFACES-209?page=comments#action_12438948 ] 
            
Arjuna Wijeyekoon commented on ADFFACES-209:
--------------------------------------------

unfortunately, calling restoreState on the sun RI UIViewRoot does not clear out the event list.
This is true for both 1.1_01 and 1.1_02.

specifically, if an error happens during processUpdateModel the event list is not cleared.
However, if the error happens during decode or validate, the event list is cleared.

So I cannot cache the UIViewRoot.  I will have to create a new one and copy over the state from the old one,
using save/restoreState().

> stateManagerImpl does not preserve state for UIViewRoot Correctly.
> ------------------------------------------------------------------
>
>                 Key: ADFFACES-209
>                 URL: http://issues.apache.org/jira/browse/ADFFACES-209
>             Project: MyFaces ADF-Faces
>          Issue Type: Bug
>            Reporter: Arjuna Wijeyekoon
>
> Currently, Trinidad's StateManagerImpl recreates the UIViewRoot component on every request.
> This causes the following bugs:
> 1. not all state is copied from the old UIViewRoot to the new UIViewRoot, specifically:
>  unique id counters and faces listeners, etc ...
> 2. If  the class for UIViewRoot component is redefined in faces-config.xml, this will break after first the first restoreState call.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (ADFFACES-209) stateManagerImpl does not preserve state for UIViewRoot Correctly.

Posted by "Arjuna Wijeyekoon (JIRA)" <ad...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/ADFFACES-209?page=comments#action_12438951 ] 
            
Arjuna Wijeyekoon commented on ADFFACES-209:
--------------------------------------------

note that step 2:
>>>>
2. because of validation errors queued events were not delivered. 
<<<<
should be
>>>>
2. because of updateModel errors queued events were not delivered. 
<<<<

> stateManagerImpl does not preserve state for UIViewRoot Correctly.
> ------------------------------------------------------------------
>
>                 Key: ADFFACES-209
>                 URL: http://issues.apache.org/jira/browse/ADFFACES-209
>             Project: MyFaces ADF-Faces
>          Issue Type: Bug
>            Reporter: Arjuna Wijeyekoon
>
> Currently, Trinidad's StateManagerImpl recreates the UIViewRoot component on every request.
> This causes the following bugs:
> 1. not all state is copied from the old UIViewRoot to the new UIViewRoot, specifically:
>  unique id counters and faces listeners, etc ...
> 2. If  the class for UIViewRoot component is redefined in faces-config.xml, this will break after first the first restoreState call.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (ADFFACES-209) stateManagerImpl does not preserve state for UIViewRoot Correctly.

Posted by "Adam Winer (JIRA)" <ad...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/ADFFACES-209?page=all ]

Adam Winer updated ADFFACES-209:
--------------------------------

        Status: Resolved  (was: Patch Available)
    Resolution: Fixed

Checked in patch.  Thanks!

> stateManagerImpl does not preserve state for UIViewRoot Correctly.
> ------------------------------------------------------------------
>
>                 Key: ADFFACES-209
>                 URL: http://issues.apache.org/jira/browse/ADFFACES-209
>             Project: MyFaces ADF-Faces
>          Issue Type: Bug
>            Reporter: Arjuna Wijeyekoon
>         Attachments: stateManager_viewroot_cache_issue.patch
>
>
> Currently, Trinidad's StateManagerImpl recreates the UIViewRoot component on every request.
> This causes the following bugs:
> 1. not all state is copied from the old UIViewRoot to the new UIViewRoot, specifically:
>  unique id counters and faces listeners, etc ...
> 2. If  the class for UIViewRoot component is redefined in faces-config.xml, this will break after first the first restoreState call.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira