You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org> on 2008/04/09 19:53:24 UTC
[jira] Created: (TAPESTRY-2339) The automatic ValueEncoder for
Hibernate entities will sometimes encode an entity as null (not its primary
key)
The automatic ValueEncoder for Hibernate entities will sometimes encode an entity as null (not its primary key)
---------------------------------------------------------------------------------------------------------------
Key: TAPESTRY-2339
URL: https://issues.apache.org/jira/browse/TAPESTRY-2339
Project: Tapestry
Issue Type: Bug
Components: tapestry-hibernate
Affects Versions: 5.0.11
Reporter: Howard M. Lewis Ship
Assignee: Howard M. Lewis Ship
Priority: Critical
Still trying to figure out under which circumstances this can occur. It may be a Hibernate problem.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Updated: (TAPESTRY-2339) The automatic ValueEncoder for
Hibernate entities will sometimes encode an entity as null (rather than its
primary key)
Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship updated TAPESTRY-2339:
-------------------------------------------
Summary: The automatic ValueEncoder for Hibernate entities will sometimes encode an entity as null (rather than its primary key) (was: The automatic ValueEncoder for Hibernate entities will sometimes encode an entity as null (not its primary key))
> The automatic ValueEncoder for Hibernate entities will sometimes encode an entity as null (rather than its primary key)
> -----------------------------------------------------------------------------------------------------------------------
>
> Key: TAPESTRY-2339
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2339
> Project: Tapestry
> Issue Type: Bug
> Components: tapestry-hibernate
> Affects Versions: 5.0.11
> Reporter: Howard M. Lewis Ship
> Assignee: Howard M. Lewis Ship
> Priority: Critical
>
> Still trying to figure out under which circumstances this can occur. It may be a Hibernate problem.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Commented: (TAPESTRY-2339) The automatic ValueEncoder for
Hibernate entities will sometimes encode an entity as null (rather than its
primary key)
Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587295#action_12587295 ]
Howard M. Lewis Ship commented on TAPESTRY-2339:
------------------------------------------------
FYI: This problem manifested itself only once I started using @ManyToOne(fetch = FetchType.LAZY) for a large number of relationships.
> The automatic ValueEncoder for Hibernate entities will sometimes encode an entity as null (rather than its primary key)
> -----------------------------------------------------------------------------------------------------------------------
>
> Key: TAPESTRY-2339
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2339
> Project: Tapestry
> Issue Type: Bug
> Components: tapestry-hibernate
> Affects Versions: 5.0.11
> Reporter: Howard M. Lewis Ship
> Assignee: Howard M. Lewis Ship
> Priority: Critical
> Fix For: 5.0.12
>
>
> Still trying to figure out under which circumstances this can occur. It may be a Hibernate problem.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Commented: (TAPESTRY-2339) The automatic ValueEncoder for
Hibernate entities will sometimes encode an entity as null (not its primary
key)
Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587278#action_12587278 ]
Howard M. Lewis Ship commented on TAPESTRY-2339:
------------------------------------------------
Not sure if it is user error or Hibernate's, but it looks like our code that gets a property accessor from Hibernate gets one of these:
org.hibernate.property.DirectPropertyAccessor$DirectGetter
And the implementation:
public Object get(Object target) throws HibernateException {
try {
return field.get(target);
}
catch (Exception e) {
throw new PropertyAccessException(e, "could not get a field value by reflection", false, clazz, name);
}
}
The object in question has been enhanced by CGLIB, but I think direct field access may not be the right approach even then, since field access should not be something that can trigger lazy loading of data into fields.
I'm going to try switching some of this logic over to Tapestry's PropertyAccessor instead.
> The automatic ValueEncoder for Hibernate entities will sometimes encode an entity as null (not its primary key)
> ---------------------------------------------------------------------------------------------------------------
>
> Key: TAPESTRY-2339
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2339
> Project: Tapestry
> Issue Type: Bug
> Components: tapestry-hibernate
> Affects Versions: 5.0.11
> Reporter: Howard M. Lewis Ship
> Assignee: Howard M. Lewis Ship
> Priority: Critical
>
> Still trying to figure out under which circumstances this can occur. It may be a Hibernate problem.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Closed: (TAPESTRY-2339) The automatic ValueEncoder for
Hibernate entities will sometimes encode an entity as null (rather than its
primary key)
Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship closed TAPESTRY-2339.
------------------------------------------
Resolution: Fixed
Fix Version/s: 5.0.12
Yep, switching to Tapestry's PropertyAccess code (which will invoke the getter, rather than reading the field) did the trick. Still not sure if this represents a bug in Hibernate or just user error on our part, but it works and that's what counts.
> The automatic ValueEncoder for Hibernate entities will sometimes encode an entity as null (rather than its primary key)
> -----------------------------------------------------------------------------------------------------------------------
>
> Key: TAPESTRY-2339
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2339
> Project: Tapestry
> Issue Type: Bug
> Components: tapestry-hibernate
> Affects Versions: 5.0.11
> Reporter: Howard M. Lewis Ship
> Assignee: Howard M. Lewis Ship
> Priority: Critical
> Fix For: 5.0.12
>
>
> Still trying to figure out under which circumstances this can occur. It may be a Hibernate problem.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org