You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Roy van Rijn (JIRA)" <ji...@apache.org> on 2007/08/17 15:52:31 UTC

[jira] Created: (WICKET-857) Method of forcing the use of transient

Method of forcing the use of transient
--------------------------------------

                 Key: WICKET-857
                 URL: https://issues.apache.org/jira/browse/WICKET-857
             Project: Wicket
          Issue Type: New Feature
          Components: wicket
    Affects Versions: 1.3.0-beta2
            Reporter: Roy van Rijn


A common problem in Wicket is that people forget to put everything in the WebPage objects on 'transient'. This will cause memory-problems. In our current project I added a little bit of code to a testclass that extends the WicketTester that takes care of this problem.

It works like this:
When a page is loaded with the WicketTester is checks all the field the Page had. If the field implements the IModel interface its ok. If the field has transient its also fine. But if there are fields that have neither it will fail the test. This way programmers are forced to make the field transient.
Because sometimes fields need to be serialized without being IModels I also added a @SkipSerializableCheck annotation.

This forces programmers using Wicket to think about serialization and they have to add a annotation to make is serializable instead of adding transient to make it non-serializable.

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


[jira] Commented: (WICKET-857) Method of forcing the use of transient

Posted by "Roy van Rijn (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12520618 ] 

Roy van Rijn commented on WICKET-857:
-------------------------------------

Isn't it common practice to make all objects that got inserted (dependency injection, Spring) transient so they don't get serialized? You have to keep the Model serialized but all the helper-fields should be serialized. The serialized part has to be as small as possible..

> Method of forcing the use of transient
> --------------------------------------
>
>                 Key: WICKET-857
>                 URL: https://issues.apache.org/jira/browse/WICKET-857
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta2
>            Reporter: Roy van Rijn
>             Fix For: 1.4.0-alpha
>
>         Attachments: added_tester_code
>
>
> A common problem in Wicket is that people forget to put everything in the WebPage objects on 'transient'. This will cause memory-problems. In our current project I added a little bit of code to a testclass that extends the WicketTester that takes care of this problem.
> It works like this:
> When a page is loaded with the WicketTester is checks all the field the Page had. If the field implements the IModel interface its ok. If the field has transient its also fine. But if there are fields that have neither it will fail the test. This way programmers are forced to make the field transient.
> Because sometimes fields need to be serialized without being IModels I also added a @SkipSerializableCheck annotation.
> This forces programmers using Wicket to think about serialization and they have to add a annotation to make is serializable instead of adding transient to make it non-serializable.

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


[jira] Updated: (WICKET-857) Method of forcing the use of transient

Posted by "Frank Bille Jensen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-857?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frank Bille Jensen updated WICKET-857:
--------------------------------------

    Fix Version/s:     (was: 1.4-M1)

> Method of forcing the use of transient
> --------------------------------------
>
>                 Key: WICKET-857
>                 URL: https://issues.apache.org/jira/browse/WICKET-857
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta2
>            Reporter: Roy van Rijn
>         Attachments: added_tester_code
>
>
> A common problem in Wicket is that people forget to put everything in the WebPage objects on 'transient'. This will cause memory-problems. In our current project I added a little bit of code to a testclass that extends the WicketTester that takes care of this problem.
> It works like this:
> When a page is loaded with the WicketTester is checks all the field the Page had. If the field implements the IModel interface its ok. If the field has transient its also fine. But if there are fields that have neither it will fail the test. This way programmers are forced to make the field transient.
> Because sometimes fields need to be serialized without being IModels I also added a @SkipSerializableCheck annotation.
> This forces programmers using Wicket to think about serialization and they have to add a annotation to make is serializable instead of adding transient to make it non-serializable.

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


[jira] Updated: (WICKET-857) Method of forcing the use of transient

Posted by "Roy van Rijn (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-857?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roy van Rijn updated WICKET-857:
--------------------------------

    Attachment: added_tester_code

I attached the code I used in my project. Feel free to use it in Wicket.

> Method of forcing the use of transient
> --------------------------------------
>
>                 Key: WICKET-857
>                 URL: https://issues.apache.org/jira/browse/WICKET-857
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta2
>            Reporter: Roy van Rijn
>         Attachments: added_tester_code
>
>
> A common problem in Wicket is that people forget to put everything in the WebPage objects on 'transient'. This will cause memory-problems. In our current project I added a little bit of code to a testclass that extends the WicketTester that takes care of this problem.
> It works like this:
> When a page is loaded with the WicketTester is checks all the field the Page had. If the field implements the IModel interface its ok. If the field has transient its also fine. But if there are fields that have neither it will fail the test. This way programmers are forced to make the field transient.
> Because sometimes fields need to be serialized without being IModels I also added a @SkipSerializableCheck annotation.
> This forces programmers using Wicket to think about serialization and they have to add a annotation to make is serializable instead of adding transient to make it non-serializable.

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


[jira] Commented: (WICKET-857) Method of forcing the use of transient

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12520620 ] 

Igor Vaynberg commented on WICKET-857:
--------------------------------------

if you use @SpringBean then no, those objects are proxies that are safe to serialize.

> Method of forcing the use of transient
> --------------------------------------
>
>                 Key: WICKET-857
>                 URL: https://issues.apache.org/jira/browse/WICKET-857
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta2
>            Reporter: Roy van Rijn
>             Fix For: 1.4.0-alpha
>
>         Attachments: added_tester_code
>
>
> A common problem in Wicket is that people forget to put everything in the WebPage objects on 'transient'. This will cause memory-problems. In our current project I added a little bit of code to a testclass that extends the WicketTester that takes care of this problem.
> It works like this:
> When a page is loaded with the WicketTester is checks all the field the Page had. If the field implements the IModel interface its ok. If the field has transient its also fine. But if there are fields that have neither it will fail the test. This way programmers are forced to make the field transient.
> Because sometimes fields need to be serialized without being IModels I also added a @SkipSerializableCheck annotation.
> This forces programmers using Wicket to think about serialization and they have to add a annotation to make is serializable instead of adding transient to make it non-serializable.

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


[jira] Commented: (WICKET-857) Method of forcing the use of transient

Posted by "Alastair Maw (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12520593 ] 

Alastair Maw commented on WICKET-857:
-------------------------------------

Hmmm. I think you have this backwards. You shouldn't be making your fields transient. Instead, you should be making sure you can serialize them. Otherwise when you rely on the fields in your onClick handlers, etc. stuff will break if your page is serialized out to disk/clustered session store/whatever. This is obviously bad!

You definitely, definitely don't want to have to specify @SkipSerializableCheck on all your fields. Besides, that's not really what you're doing. You're checking to see if it's transient. That's not checking to see if it's serializable.

Wicket already handles this by making sure your fields are serializable in dev mode with nice error reporting if they're not.

In short, I'm sorry but I think you have the wrong end of the stick here - making your fields transient is not the correct solution to whatever problem you're seeing.

This should be marked invalid.

> Method of forcing the use of transient
> --------------------------------------
>
>                 Key: WICKET-857
>                 URL: https://issues.apache.org/jira/browse/WICKET-857
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta2
>            Reporter: Roy van Rijn
>             Fix For: 1.4.0-alpha
>
>         Attachments: added_tester_code
>
>
> A common problem in Wicket is that people forget to put everything in the WebPage objects on 'transient'. This will cause memory-problems. In our current project I added a little bit of code to a testclass that extends the WicketTester that takes care of this problem.
> It works like this:
> When a page is loaded with the WicketTester is checks all the field the Page had. If the field implements the IModel interface its ok. If the field has transient its also fine. But if there are fields that have neither it will fail the test. This way programmers are forced to make the field transient.
> Because sometimes fields need to be serialized without being IModels I also added a @SkipSerializableCheck annotation.
> This forces programmers using Wicket to think about serialization and they have to add a annotation to make is serializable instead of adding transient to make it non-serializable.

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


[jira] Resolved: (WICKET-857) Method of forcing the use of transient

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-857?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-857.
----------------------------------

    Resolution: Won't Fix

> Method of forcing the use of transient
> --------------------------------------
>
>                 Key: WICKET-857
>                 URL: https://issues.apache.org/jira/browse/WICKET-857
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta2
>            Reporter: Roy van Rijn
>             Fix For: 1.4.0-alpha
>
>         Attachments: added_tester_code
>
>
> A common problem in Wicket is that people forget to put everything in the WebPage objects on 'transient'. This will cause memory-problems. In our current project I added a little bit of code to a testclass that extends the WicketTester that takes care of this problem.
> It works like this:
> When a page is loaded with the WicketTester is checks all the field the Page had. If the field implements the IModel interface its ok. If the field has transient its also fine. But if there are fields that have neither it will fail the test. This way programmers are forced to make the field transient.
> Because sometimes fields need to be serialized without being IModels I also added a @SkipSerializableCheck annotation.
> This forces programmers using Wicket to think about serialization and they have to add a annotation to make is serializable instead of adding transient to make it non-serializable.

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


[jira] Updated: (WICKET-857) Method of forcing the use of transient

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-857?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg updated WICKET-857:
---------------------------------

    Fix Version/s: 1.4.0-alpha

i dont know how common a problem this is, if at all. at least we havent heard anything like this from users yet. anyways, i am going to reschedule this for 1.4, 1.3 is jdk 1.4 and so doesnt support annotations.

> Method of forcing the use of transient
> --------------------------------------
>
>                 Key: WICKET-857
>                 URL: https://issues.apache.org/jira/browse/WICKET-857
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta2
>            Reporter: Roy van Rijn
>             Fix For: 1.4.0-alpha
>
>         Attachments: added_tester_code
>
>
> A common problem in Wicket is that people forget to put everything in the WebPage objects on 'transient'. This will cause memory-problems. In our current project I added a little bit of code to a testclass that extends the WicketTester that takes care of this problem.
> It works like this:
> When a page is loaded with the WicketTester is checks all the field the Page had. If the field implements the IModel interface its ok. If the field has transient its also fine. But if there are fields that have neither it will fail the test. This way programmers are forced to make the field transient.
> Because sometimes fields need to be serialized without being IModels I also added a @SkipSerializableCheck annotation.
> This forces programmers using Wicket to think about serialization and they have to add a annotation to make is serializable instead of adding transient to make it non-serializable.

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