[hibernate-issues] [Hibernate-JIRA] Issue Comment Edited: (HHH-6744) TransientObjectException thrown on dirty check during flush with CHECK_NULLABILITY set to false
Gail Badner (JIRA)
noreply at atlassian.com
Wed Jan 11 07:48:11 EST 2012
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44978#comment-44978 ]
Gail Badner edited comment on HHH-6744 at 1/11/12 6:47 AM:
-----------------------------------------------------------
After discussing this with Emmanuel, we agreed that it is appropriate for Hibernate to throw an exception if it is known that a non-nullable entity association is transient, rather than waiting for the insert to fail with JDBCException.
Emmanuel suggested that PropertyValueException might be a more appropriate exception than TransientObjectException in this case.
This issue will be fixed by HHH-6957 as this case will be detected by the persist/save/merge operations, rather than during flush.
was (Author: gbadner):
After discussing this with Emmanuel, we agreed that it is appropriate for Hibernate to throw an exception if it is known that a non-nullable entity association is transient, rather than waiting for the insert to fail with JDBCException.
Emmanuel suggested that PropertyValueException might be a more appropriate exception than TransientObjectException in this case.
This issue will be fixed by HHH-5472 as this case will be detected by the save operation, rather than during flush.
> TransientObjectException thrown on dirty check during flush with CHECK_NULLABILITY set to false
> -----------------------------------------------------------------------------------------------
>
> Key: HHH-6744
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6744
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 4.0.0.CR4
> Reporter: Gail Badner
> Assignee: Gail Badner
> Fix For: 4.1.0
>
>
> TransientObjectException thrown on dirty check of a many-to-one association during flush with CHECK_NULLABILITY set to false when the entity being dirty-checked:
> - has a "delayed-insert" ID generator (e.g., sequence, increment),
> - has been saved, but not flushed
> This may also happen on an update.
>
> I believe JDBCException should be thrown instead.
> This is reproduced by testMergeEntityWithNonNullableTransientEntity() in:
> - MultiPathCircleCascadeTest for Oracle10gDialect and PostgreSQLDialect
> (because these dialects use sequences for the native ID generator and the default for CHECK_NULLABILITY is false)
> - MultiPathCircleCascadeCheckNullibilityFalseTest for Oracle10gDialect and PostgreSQLDialect
> (because these dialects use sequences for the native ID generator and CHECK_NULLABILITY is explicitly set to false)
> - MultiPathCircleCascadeDelayedInsertTest for all dialects
> (because the test uses an "increment" generator and the default for CHECK_NULLABILITY is false)
> - MultiPathCircleCascadeCheckNullFalseDelayedInsertTest
> (because the test uses an "increment" generator and CHECK_NULLABILITY is explicitly set to false)
> The failure is masked in MultiPathCircleCascadeDelayedInsertTest and MultiPathCircleCascadeCheckNullFalseDelayedInsertTest because they incorrectly allow TransientObjectException as valid behavior.
--
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