[
http://opensource.atlassian.com/projects/hibernate/browse/HV-245?page=com...
]
Emmanuel Bernard commented on HV-245:
-------------------------------------
See Kevin's argument
-------
During our testing of OpenJPA with the Hibernate BeanValidation RI, we hit the same issue
as documented in this JIRA HV-213. I see that you voiced your agreement that these should
not be Serializable. In a distributed environment, having these ConstraintViolations
serializable would be a great benefit. I can understand the hesitancy due to Entities (or
other object types) not being Serializable and thus causing some type of RuntimeException.
But, even the JPA spec outlines this usage...
Section 2.1
"If an entity instance is to be passed by value as a detached object (e.g., through a
remote interface), the
entity class must implement the Serializable interface."
And, in section 3.4.5
"Entities that may be referenced in
wrapped exceptions should implement Serializable so that marshalling will not fail."
It would seem that allowing ConstraintViolations to be Serializable would be consistent
with the expectations. Without making this type of change, it will require all of the
server environments to first catch the ConstraintViolation and then re-package it in a
client acceptable Serializable exception. A lot of wasted cycles for a common scenario.
Can you take another look at this Issue?
Thanks,
Kevin
Make ConstraintViolation + Path implementations Serializable
------------------------------------------------------------
Key: HV-245
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HV-245
Project: Hibernate Validator
Issue Type: Improvement
Components: engine
Affects Versions: 4.0.0.CR1
Reporter: Emmanuel Bernard
Assignee: Hardy Ferentschik
While we agree that in HV-213 ConstraintViolation was not to be marked Serializable, I
believe that if the CV implementation is serializable and if the entities and values are
serializable, then the ConstraintViolationException would be serializable in effect.
If true (should be tested quickly), this would be a cheap way to ensure that if entities
and serializable, the violation reports are serializable as well.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira