Laird Nelson (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYTg5NmI2MjYx...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-15738?atlOrigin=eyJpIjoiYTg5Nm...
) HHH-15738 (
https://hibernate.atlassian.net/browse/HHH-15738?atlOrigin=eyJpIjoiYTg5Nm...
) Hibernate's EntityManager#persist(Object) implementation can throw
PersistenceException, which the spec does not permit (
https://hibernate.atlassian.net/browse/HHH-15738?atlOrigin=eyJpIjoiYTg5Nm...
)
Issue Type: Bug Affects Versions: 6.1.4 Assignee: Unassigned Components: hibernate-core
Created: 21/Nov/2022 10:23 AM Environment: Hibernate 6.1.4, though I suspect this problem
has existed for a long time Priority: Major Reporter: Laird Nelson (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
To reproduce:
* Put an entity into the persistence context, then remove it. Now you have a detached
entity.
* Call EntityManager#persist(Object) with the detached entity.
* Observe that Hibernate throws a PersistenceException. Note that the javadocs (
https://jakarta.ee/specifications/persistence/3.1/apidocs/jakarta.persist...
) do not permit this kind of exception to be thrown.
Perhaps an IllegalArgumentException should be thrown instead?
(
https://hibernate.atlassian.net/browse/HHH-15738#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15738#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100210- sha1:9b34d7c )