You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Patrick Linskey (JIRA)" <ji...@apache.org> on 2010/08/01 23:53:15 UTC
[jira] Created: (OPENJPA-1755) MultiClassLoader relies on its
underlying ClassLoaders for hashCode
MultiClassLoader relies on its underlying ClassLoaders for hashCode
-------------------------------------------------------------------
Key: OPENJPA-1755
URL: https://issues.apache.org/jira/browse/OPENJPA-1755
Project: OpenJPA
Issue Type: Bug
Reporter: Patrick Linskey
The MultiClassLoader relies on its underlying ClassLoaders in its hashing algorithm. This is problematic if the underlying classloaders refuse to return a hash or if the classloader list changes over time.
I ran into a problem that demanded a resolution to this issue when doing some work with OpenJPA in a Google AppEngine context. I don't have a stack trace handy.
An effective-yet-ugly fix was to simply change the hashCode() implementation to return a constant value (I chose '1'). This clearly is a crappy hashing algorithm, but will always respect the hashing contract. And I don't think that we really put MultiClassLoaders into big maps or anything.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (OPENJPA-1755) MultiClassLoader relies on its
underlying ClassLoaders for hashCode
Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1755?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Linskey updated OPENJPA-1755:
-------------------------------------
Attachment: (was: OPENJPA-1755.txt)
> MultiClassLoader relies on its underlying ClassLoaders for hashCode
> -------------------------------------------------------------------
>
> Key: OPENJPA-1755
> URL: https://issues.apache.org/jira/browse/OPENJPA-1755
> Project: OpenJPA
> Issue Type: Bug
> Reporter: Patrick Linskey
> Attachments: OPENJPA-1755.txt
>
>
> The MultiClassLoader relies on its underlying ClassLoaders in its hashing algorithm. This is problematic if the underlying classloaders refuse to return a hash or if the classloader list changes over time.
> I ran into a problem that demanded a resolution to this issue when doing some work with OpenJPA in a Google AppEngine context. I don't have a stack trace handy.
> An effective-yet-ugly fix was to simply change the hashCode() implementation to return a constant value (I chose '1'). This clearly is a crappy hashing algorithm, but will always respect the hashing contract. And I don't think that we really put MultiClassLoaders into big maps or anything.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-1755) MultiClassLoader relies on its
underlying ClassLoaders for hashCode
Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913200#action_12913200 ]
Rick Curtis commented on OPENJPA-1755:
--------------------------------------
Any more context? I think anyone would be hard pressed to commit this change without more info.
> MultiClassLoader relies on its underlying ClassLoaders for hashCode
> -------------------------------------------------------------------
>
> Key: OPENJPA-1755
> URL: https://issues.apache.org/jira/browse/OPENJPA-1755
> Project: OpenJPA
> Issue Type: Bug
> Reporter: Patrick Linskey
> Attachments: OPENJPA-1755.txt
>
>
> The MultiClassLoader relies on its underlying ClassLoaders in its hashing algorithm. This is problematic if the underlying classloaders refuse to return a hash or if the classloader list changes over time.
> I ran into a problem that demanded a resolution to this issue when doing some work with OpenJPA in a Google AppEngine context. I don't have a stack trace handy.
> An effective-yet-ugly fix was to simply change the hashCode() implementation to return a constant value (I chose '1'). This clearly is a crappy hashing algorithm, but will always respect the hashing contract. And I don't think that we really put MultiClassLoaders into big maps or anything.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-1755) MultiClassLoader relies on its
underlying ClassLoaders for hashCode
Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913247#action_12913247 ]
Donald Woods commented on OPENJPA-1755:
---------------------------------------
Patrick, was hashCode() throwing an Exception for you in your GAE scenario? If so, catching the exception, log a msg and then return 1 might be an acceptable compromise....
> MultiClassLoader relies on its underlying ClassLoaders for hashCode
> -------------------------------------------------------------------
>
> Key: OPENJPA-1755
> URL: https://issues.apache.org/jira/browse/OPENJPA-1755
> Project: OpenJPA
> Issue Type: Bug
> Reporter: Patrick Linskey
> Attachments: OPENJPA-1755.txt
>
>
> The MultiClassLoader relies on its underlying ClassLoaders in its hashing algorithm. This is problematic if the underlying classloaders refuse to return a hash or if the classloader list changes over time.
> I ran into a problem that demanded a resolution to this issue when doing some work with OpenJPA in a Google AppEngine context. I don't have a stack trace handy.
> An effective-yet-ugly fix was to simply change the hashCode() implementation to return a constant value (I chose '1'). This clearly is a crappy hashing algorithm, but will always respect the hashing contract. And I don't think that we really put MultiClassLoaders into big maps or anything.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (OPENJPA-1755) MultiClassLoader relies on its
underlying ClassLoaders for hashCode
Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1755?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Linskey updated OPENJPA-1755:
-------------------------------------
Attachment: OPENJPA-1755.txt
If this looks like a satisfactory hashCode impl to others, let me know and I'll commit the diff.
> MultiClassLoader relies on its underlying ClassLoaders for hashCode
> -------------------------------------------------------------------
>
> Key: OPENJPA-1755
> URL: https://issues.apache.org/jira/browse/OPENJPA-1755
> Project: OpenJPA
> Issue Type: Bug
> Reporter: Patrick Linskey
> Attachments: OPENJPA-1755.txt
>
>
> The MultiClassLoader relies on its underlying ClassLoaders in its hashing algorithm. This is problematic if the underlying classloaders refuse to return a hash or if the classloader list changes over time.
> I ran into a problem that demanded a resolution to this issue when doing some work with OpenJPA in a Google AppEngine context. I don't have a stack trace handy.
> An effective-yet-ugly fix was to simply change the hashCode() implementation to return a constant value (I chose '1'). This clearly is a crappy hashing algorithm, but will always respect the hashing contract. And I don't think that we really put MultiClassLoaders into big maps or anything.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (OPENJPA-1755) MultiClassLoader relies on its
underlying ClassLoaders for hashCode
Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1755?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Linskey updated OPENJPA-1755:
-------------------------------------
Attachment: OPENJPA-1755.txt
> MultiClassLoader relies on its underlying ClassLoaders for hashCode
> -------------------------------------------------------------------
>
> Key: OPENJPA-1755
> URL: https://issues.apache.org/jira/browse/OPENJPA-1755
> Project: OpenJPA
> Issue Type: Bug
> Reporter: Patrick Linskey
> Attachments: OPENJPA-1755.txt
>
>
> The MultiClassLoader relies on its underlying ClassLoaders in its hashing algorithm. This is problematic if the underlying classloaders refuse to return a hash or if the classloader list changes over time.
> I ran into a problem that demanded a resolution to this issue when doing some work with OpenJPA in a Google AppEngine context. I don't have a stack trace handy.
> An effective-yet-ugly fix was to simply change the hashCode() implementation to return a constant value (I chose '1'). This clearly is a crappy hashing algorithm, but will always respect the hashing contract. And I don't think that we really put MultiClassLoaders into big maps or anything.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.