[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-6957) Throw TransientPropertyValueException if there are unresolved entity insert actions after persist/save/merge listeners execute

Gail Badner (JIRA) noreply at atlassian.com
Tue Jan 24 19:20:09 EST 2012


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6957?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gail Badner updated HHH-6957:
-----------------------------

    Description: 
The current behavior (before this proposed change) is kind of complicated when an entity has a non-nullable, transient reference that is not resolved by cascading.

When CHECK_NULLABILITY is true:
- persist/save/merge event listeners will throw PropertyValueException;

When CHECK_NULLABILITY is false:
- if the entity insert action is executed before the session is flushed (i.e., an "early" insert to generate an identity ID), then JDBCException is thrown;
- otherwise, TransientObjectException is thrown when the owning entity is dirty-checked.

The proposed change would make the behavior consistent for all of these cases. If there are any "unresolved" non-nullable, transient entities after the top-level persist/save/merge event executes, then TransientPropertyValueException would be thrown, regardless of the CHECK_NULLABILITY setting.

TransientPropertyValueException will extend TransientObjectException and will have the transient entity name and property path available (like PropertyValueException). Since it extends TransientObjectException, it will be remapped properly by Entity Manager.

  was:
The current behavior (before this proposed change) is kind of complicated when an entity has a non-nullable, transient reference that is not resolved by cascading.

When CHECK_NULLABILITY is true:
- persist/save/merge event listeners will throw PropertyValueException;

When CHECK_NULLABILITY is false:
- if the entity insert action is executed before the session is flushed (i.e., an "early" insert to generate an identity ID), then JDBCException is thrown;
- otherwise, TransientObjectException is thrown when the owning entity is dirty-checked.

The proposed change would make the behavior consistent for all of these cases. If there are any "unresolved" non-nullable, transient entities after the top-level persist/save/merge event executes, then PropertyValueException would be thrown, regardless of the CHECK_NULLABILITY setting.

        Summary: Throw TransientPropertyValueException if there are unresolved entity insert actions after persist/save/merge listeners execute  (was: Throw PropertyValueException if there are unresolved entity insert actions after persist/save/merge listeners execute)

> Throw TransientPropertyValueException if there are unresolved entity insert actions after persist/save/merge listeners execute
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HHH-6957
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6957
>             Project: Hibernate ORM
>          Issue Type: Improvement
>          Components: core
>            Reporter: Gail Badner
>            Assignee: Gail Badner
>             Fix For: 4.1.0
>
>
> The current behavior (before this proposed change) is kind of complicated when an entity has a non-nullable, transient reference that is not resolved by cascading.
> When CHECK_NULLABILITY is true:
> - persist/save/merge event listeners will throw PropertyValueException;
> When CHECK_NULLABILITY is false:
> - if the entity insert action is executed before the session is flushed (i.e., an "early" insert to generate an identity ID), then JDBCException is thrown;
> - otherwise, TransientObjectException is thrown when the owning entity is dirty-checked.
> The proposed change would make the behavior consistent for all of these cases. If there are any "unresolved" non-nullable, transient entities after the top-level persist/save/merge event executes, then TransientPropertyValueException would be thrown, regardless of the CHECK_NULLABILITY setting.
> TransientPropertyValueException will extend TransientObjectException and will have the transient entity name and property path available (like PropertyValueException). Since it extends TransientObjectException, it will be remapped properly by Entity Manager.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list