[jira] [Commented] (WICKET-6644) AbstractPageableView can only be serialized with Java built-in serialization
[ https://issues.apache.org/jira/browse/WICKET-6644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16791667#comment-16791667 ] Thomas Heigl commented on WICKET-6644: -- Thanks a lot Sven! > AbstractPageableView can only be serialized with Java built-in serialization > > > Key: WICKET-6644 > URL: https://issues.apache.org/jira/browse/WICKET-6644 > Project: Wicket > Issue Type: Improvement > Components: wicket-core >Affects Versions: 8.3.0 >Reporter: Thomas Heigl >Assignee: Sven Meier >Priority: Major > Fix For: 9.0.0, 8.4.0 > > > I'm in the progress of replacing FST serialization, that we have used in > production for years, with Kryo. > FST is a drop-in replacement for Java's built-in serialization and respects > the {{readObject/writeObject}} contract. Kryo does not rely on Java > serialization at all. > All of Wicket's classes can be serialized with recent versions of Kryo > without problems, but when I did some exploratory testing, I noticed that all > our pageable lists were empty after deserialization. > After some investigation, I found the root cause of this: WICKET-1323 > {{AbstractPageableView}} is the *only* class in Wicket that relies a custom > {{readObject}} method to correctly restore its state. > I propose to get rid of this method and simply initialize the transient field > to a default value of {{-1}} or use a {{Long}} instead of a {{long}} to > represent the cached item count. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WICKET-6644) AbstractPageableView can only be serialized with Java built-in serialization
[ https://issues.apache.org/jira/browse/WICKET-6644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16791610#comment-16791610 ] ASF subversion and git services commented on WICKET-6644: - Commit c7eecfeb6b67edee89820aaba46434a9e5a838e3 in wicket's branch refs/heads/master from Sven Meier [ https://gitbox.apache.org/repos/asf?p=wicket.git;h=c7eecfe ] WICKET-6644 use null instead of -1 to indicate cache cleared > AbstractPageableView can only be serialized with Java built-in serialization > > > Key: WICKET-6644 > URL: https://issues.apache.org/jira/browse/WICKET-6644 > Project: Wicket > Issue Type: Improvement > Components: wicket-core >Affects Versions: 8.3.0 >Reporter: Thomas Heigl >Assignee: Sven Meier >Priority: Major > > I'm in the progress of replacing FST serialization, that we have used in > production for years, with Kryo. > FST is a drop-in replacement for Java's built-in serialization and respects > the {{readObject/writeObject}} contract. Kryo does not rely on Java > serialization at all. > All of Wicket's classes can be serialized with recent versions of Kryo > without problems, but when I did some exploratory testing, I noticed that all > our pageable lists were empty after deserialization. > After some investigation, I found the root cause of this: WICKET-1323 > {{AbstractPageableView}} is the *only* class in Wicket that relies a custom > {{readObject}} method to correctly restore its state. > I propose to get rid of this method and simply initialize the transient field > to a default value of {{-1}} or use a {{Long}} instead of a {{long}} to > represent the cached item count. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WICKET-6644) AbstractPageableView can only be serialized with Java built-in serialization
[ https://issues.apache.org/jira/browse/WICKET-6644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16791599#comment-16791599 ] ASF subversion and git services commented on WICKET-6644: - Commit c59b809f3119906155369218c4a551d230036eb0 in wicket's branch refs/heads/wicket-8.x from Sven Meier [ https://gitbox.apache.org/repos/asf?p=wicket.git;h=c59b809 ] WICKET-6644 use null instead of -1 to indicate cache cleared > AbstractPageableView can only be serialized with Java built-in serialization > > > Key: WICKET-6644 > URL: https://issues.apache.org/jira/browse/WICKET-6644 > Project: Wicket > Issue Type: Improvement > Components: wicket-core >Affects Versions: 8.3.0 >Reporter: Thomas Heigl >Assignee: Sven Meier >Priority: Major > > I'm in the progress of replacing FST serialization, that we have used in > production for years, with Kryo. > FST is a drop-in replacement for Java's built-in serialization and respects > the {{readObject/writeObject}} contract. Kryo does not rely on Java > serialization at all. > All of Wicket's classes can be serialized with recent versions of Kryo > without problems, but when I did some exploratory testing, I noticed that all > our pageable lists were empty after deserialization. > After some investigation, I found the root cause of this: WICKET-1323 > {{AbstractPageableView}} is the *only* class in Wicket that relies a custom > {{readObject}} method to correctly restore its state. > I propose to get rid of this method and simply initialize the transient field > to a default value of {{-1}} or use a {{Long}} instead of a {{long}} to > represent the cached item count. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WICKET-6644) AbstractPageableView can only be serialized with Java built-in serialization
[ https://issues.apache.org/jira/browse/WICKET-6644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16791443#comment-16791443 ] Thomas Heigl commented on WICKET-6644: -- Should I create a PR for this? Which option do you prefer? Initialize the field to `-1` or change it to a `Long`? This is the code in question: {code:java} public abstract class AbstractPageableView extends RefreshingView implements IPageableItems { /** * cachedItemCount is used to cache the call to internalGetItemCount() * for the duration of the request because that call can potentially be expensive ( a select * count query ) and so we do not want to execute it multiple times. */ private transient long cachedItemCount; private void clearCachedItemCount() { cachedItemCount = -1; } private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { // Read in all fields s.defaultReadObject(); clearCachedItemCount(); } }{code} > AbstractPageableView can only be serialized with Java built-in serialization > > > Key: WICKET-6644 > URL: https://issues.apache.org/jira/browse/WICKET-6644 > Project: Wicket > Issue Type: Improvement > Components: wicket-core >Affects Versions: 8.3.0 >Reporter: Thomas Heigl >Priority: Major > > I'm in the progress of replacing FST serialization, that we have used in > production for years, with Kryo. > FST is a drop-in replacement for Java's built-in serialization and respects > the {{readObject/writeObject}} contract. Kryo does not rely on Java > serialization at all. > All of Wicket's classes can be serialized with recent versions of Kryo > without problems, but when I did some exploratory testing, I noticed that all > our pageable lists were empty after deserialization. > After some investigation, I found the root cause of this: WICKET-1323 > {{AbstractPageableView}} is the *only* class in Wicket that relies a custom > {{readObject}} method to correctly restore its state. > I propose to get rid of this method and simply initialize the transient field > to a default value of {{-1}} or use a {{Long}} instead of a {{long}} to > represent the cached item count. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WICKET-6644) AbstractPageableView can only be serialized with Java built-in serialization
[ https://issues.apache.org/jira/browse/WICKET-6644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=1674#comment-1674 ] Maxim Solodovnik commented on WICKET-6644: -- +1 to unify this > AbstractPageableView can only be serialized with Java built-in serialization > > > Key: WICKET-6644 > URL: https://issues.apache.org/jira/browse/WICKET-6644 > Project: Wicket > Issue Type: Improvement > Components: wicket-core >Affects Versions: 8.3.0 >Reporter: Thomas Heigl >Priority: Major > > I'm in the progress of replacing FST serialization, that we have used in > production for years, with Kryo. > FST is a drop-in replacement for Java's built-in serialization and respects > the {{readObject/writeObject}} contract. Kryo does not rely on Java > serialization at all. > All of Wicket's classes can be serialized with recent versions of Kryo > without problems, but when I did some exploratory testing, I noticed that all > our pageable lists were empty after deserialization. > After some investigation, I found the root cause of this: WICKET-1323 > {{AbstractPageableView}} is the *only* class in Wicket that relies a custom > {{readResolve}} method to correctly restore its sate. > I propose to get rid of this method and simply initialize the transient field > to a default value of {{-1}} or use a {{Long}} instead of a {{long}} to > represent that cached item count. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WICKET-6644) AbstractPageableView can only be serialized with Java built-in serialization
[ https://issues.apache.org/jira/browse/WICKET-6644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=1672#comment-1672 ] Thomas Heigl commented on WICKET-6644: -- This is the commit that introduced the {{readResolve}} method: https://github.com/apache/wicket/commit/a3cf4a0cf43ee96878a9c9167913a9d7ee03cf3e > AbstractPageableView can only be serialized with Java built-in serialization > > > Key: WICKET-6644 > URL: https://issues.apache.org/jira/browse/WICKET-6644 > Project: Wicket > Issue Type: Improvement > Components: wicket-core >Affects Versions: 8.3.0 >Reporter: Thomas Heigl >Priority: Major > > I'm in the progress of replacing FST serialization, that we have used in > production for years, with Kryo. > FST is a drop-in replacement for Java's built-in serialization and respects > the {{readObject/writeObject}} contract. Kryo does not rely on Java > serialization at all. > All of Wicket's classes can be serialized with recent versions of Kryo > without problems, but when I did some exploratory testing, I noticed that all > our pageable lists were empty after deserialization. > After some investigation, I found the root cause of this: WICKET-1323 > {{AbstractPageableView}} is the *only* class in Wicket that relies a custom > {{readResolve}} method to correctly restore its sate. > I propose to get rid of this method and simply initialize the transient field > to a default value of {{-1}} or use a {{Long}} instead of a {{long}} to > represent that cached item count. -- This message was sent by Atlassian JIRA (v7.6.3#76005)