You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by "Scott Wilson (Created) (JIRA)" <ji...@apache.org> on 2012/01/27 16:12:10 UTC

[jira] [Created] (WOOKIE-306) Widget Interface: Conflicts when using Clear() and SetItem()

Widget Interface: Conflicts when using Clear() and SetItem()
------------------------------------------------------------

                 Key: WOOKIE-306
                 URL: https://issues.apache.org/jira/browse/WOOKIE-306
             Project: Wookie
          Issue Type: Bug
            Reporter: Scott Wilson


When running the W3C Test Case "au", Wookie fails to correctly set a value after calling clear() first and then reloading the page.

This is likely caused by the clear() process executing and overriding the subsequent (in script order terms) setItem() call, either on the client side or server side. 

To replicate, use this widget:

http://dev.w3.org/2006/waf/widgets-api/test-suite/test-cases/ta-aa/au/au.wgt

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WOOKIE-306) Widget Interface: Conflicts when using Clear() and SetItem()

Posted by "Paul Sharples (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WOOKIE-306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13197012#comment-13197012 ] 

Paul Sharples commented on WOOKIE-306:
--------------------------------------

Just a heads up. I have been looking at this and...

The test expects "test1" to be null (but its actually our friend "undefined" again.)

If you fix that in the test we start to get inconsistent results.

Sometimes the test passes, most times it doesn't.  It would appear that the updates are being persisted back to the DB ok when you open the widget the first time. (running against mysql I can check what the db looks like after opening the widget for the first time)
However, if you open the widget again (subsequent calls are made back to the WidgetImpl class to retrieve the preferences) the results usually have either test3 as not set or test1 still being in the recordset.(it shouldn't be and no tuple exists for it in the db).

It looks as though the WidgetImpl::preferences call has a stale read state somehow. Note, this happens with both queues switched and switched off.
                
> Widget Interface: Conflicts when using Clear() and SetItem()
> ------------------------------------------------------------
>
>                 Key: WOOKIE-306
>                 URL: https://issues.apache.org/jira/browse/WOOKIE-306
>             Project: Wookie
>          Issue Type: Bug
>            Reporter: Scott Wilson
>
> When running the W3C Test Case "au", Wookie fails to correctly set a value after calling clear() first and then reloading the page.
> This is likely caused by the clear() process executing and overriding the subsequent (in script order terms) setItem() call, either on the client side or server side. 
> To replicate, use this widget:
> http://dev.w3.org/2006/waf/widgets-api/test-suite/test-cases/ta-aa/au/au.wgt

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WOOKIE-306) Widget Interface: Conflicts when using Clear() and SetItem()

Posted by "Scott Wilson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WOOKIE-306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13197776#comment-13197776 ] 

Scott Wilson commented on WOOKIE-306:
-------------------------------------

Yes, I'd noticed that warning crop up. The only thing I came across as a possible explanation was a discussion on the "leakiness" of the enhanced Collection object (aka the Smart Proxy) that JPA creates for child Collections; as we subclass Collection with the specialized InverseRelationshipCollection class this may well be the problem:

http://grep.elasticpath.com/community/techblog/blog/2010/09/21/openjpa-and-collection-smart-proxies;jsessionid=995420CAB9020A69299283D2E26D5A30

However, when I tried to change WidgetInstanceImpl.preferences to a regular Collection type it broke a load of other things so I reverted it. 

At least with this fix we do get better consistency, even if its not perfect, so I'm happy to close this one.
                
> Widget Interface: Conflicts when using Clear() and SetItem()
> ------------------------------------------------------------
>
>                 Key: WOOKIE-306
>                 URL: https://issues.apache.org/jira/browse/WOOKIE-306
>             Project: Wookie
>          Issue Type: Bug
>            Reporter: Scott Wilson
>             Fix For: 0.9.2
>
>
> When running the W3C Test Case "au", Wookie fails to correctly set a value after calling clear() first and then reloading the page.
> This is likely caused by the clear() process executing and overriding the subsequent (in script order terms) setItem() call, either on the client side or server side. 
> To replicate, use this widget:
> http://dev.w3.org/2006/waf/widgets-api/test-suite/test-cases/ta-aa/au/au.wgt

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WOOKIE-306) Widget Interface: Conflicts when using Clear() and SetItem()

Posted by "Paul Sharples (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WOOKIE-306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13197771#comment-13197771 ] 

Paul Sharples commented on WOOKIE-306:
--------------------------------------

This works a lot better now and the test passes everytime.  Occasionally there is a warning in the console...

11:48:06,244  WARN Runtime:89 - Detected possible orphaned reference to deleted
object "[761, 762, 763, 764]" in "org.apache.wookie.beans.jpa.impl.WidgetInstanceImpl.preferences<element:class org.apache.wookie.beans.jpa.impl.PreferenceImpl>" of instance "703".

...where 762 is the 'test1' tuple which has been removed in the database after opening the 'au' widget the first time.

If you are happy with it we can close this.  However, as you mention i think longer term we need to re-think our persistence mechanism, to try and get rid of these kinds of issues.
                
> Widget Interface: Conflicts when using Clear() and SetItem()
> ------------------------------------------------------------
>
>                 Key: WOOKIE-306
>                 URL: https://issues.apache.org/jira/browse/WOOKIE-306
>             Project: Wookie
>          Issue Type: Bug
>            Reporter: Scott Wilson
>             Fix For: 0.9.2
>
>
> When running the W3C Test Case "au", Wookie fails to correctly set a value after calling clear() first and then reloading the page.
> This is likely caused by the clear() process executing and overriding the subsequent (in script order terms) setItem() call, either on the client side or server side. 
> To replicate, use this widget:
> http://dev.w3.org/2006/waf/widgets-api/test-suite/test-cases/ta-aa/au/au.wgt

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (WOOKIE-306) Widget Interface: Conflicts when using Clear() and SetItem()

Posted by "Paul Sharples (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WOOKIE-306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13197012#comment-13197012 ] 

Paul Sharples edited comment on WOOKIE-306 at 1/31/12 4:49 PM:
---------------------------------------------------------------

Just a heads up. I have been looking at this and...

The test expects "test1" to be null (but its actually our friend "undefined" again.)

If you fix that in the test we start to get inconsistent results.

Sometimes the test passes, most times it doesn't.  It would appear that the updates are being persisted back to the DB ok when you open the widget the first time. (running against mysql I can check what the db looks like after opening the widget for the first time)
However, if you open the widget again (subsequent calls are made back to the WidgetAPIImpl class to retrieve the preferences) the results usually have either test3 as not set or test1 still being in the recordset.(it shouldn't be and no tuple exists for it in the db).

It looks as though the WidgetAPIImpl::preferences call has a stale read state somehow. Note, this happens with both queues switched on and switched off.
                
      was (Author: psharples):
    Just a heads up. I have been looking at this and...

The test expects "test1" to be null (but its actually our friend "undefined" again.)

If you fix that in the test we start to get inconsistent results.

Sometimes the test passes, most times it doesn't.  It would appear that the updates are being persisted back to the DB ok when you open the widget the first time. (running against mysql I can check what the db looks like after opening the widget for the first time)
However, if you open the widget again (subsequent calls are made back to the WidgetImpl class to retrieve the preferences) the results usually have either test3 as not set or test1 still being in the recordset.(it shouldn't be and no tuple exists for it in the db).

It looks as though the WidgetImpl::preferences call has a stale read state somehow. Note, this happens with both queues switched and switched off.
                  
> Widget Interface: Conflicts when using Clear() and SetItem()
> ------------------------------------------------------------
>
>                 Key: WOOKIE-306
>                 URL: https://issues.apache.org/jira/browse/WOOKIE-306
>             Project: Wookie
>          Issue Type: Bug
>            Reporter: Scott Wilson
>
> When running the W3C Test Case "au", Wookie fails to correctly set a value after calling clear() first and then reloading the page.
> This is likely caused by the clear() process executing and overriding the subsequent (in script order terms) setItem() call, either on the client side or server side. 
> To replicate, use this widget:
> http://dev.w3.org/2006/waf/widgets-api/test-suite/test-cases/ta-aa/au/au.wgt

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira