[Hibernate-JIRA] Created: (HHH-2890) Hibernate cannot wrap HSQLDB constraint violations exceptions
by Baptiste MATHUS (JIRA)
Hibernate cannot wrap HSQLDB constraint violations exceptions
-------------------------------------------------------------
Key: HHH-2890
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2890
Project: Hibernate3
Issue Type: Sub-task
Components: core
Affects Versions: 3.2.1
Reporter: Baptiste MATHUS
Priority: Minor
Attachments: UnitTestConstraintBug.zip
Since I can't attach a file to a bug that hasn't been logged by me. I'll create a sub-bug, since logging a bug was anyway something I planned to do when I created the testcase.
In the attached zip, you'll find a project that has two entities: Customer and Invoice. An Invoice references a Customer. I show that trying to delete a Customer that's referenced by an invoice doesn't throw a ConstraintViolationException with HSQLDB (1.8.0.7 or 1.7.3.3 gives the same result).
The testcase is in the test package.
I hope this helps tackle the problem. Before logging a bug in the HSQL tracker, I'd really appreciate to have your opinion. Shoud I do it?
FYI, I tested the very same code on Oracle, and the ConstraintViolationException is very well thrown...
--
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
18 years, 1 month
[Hibernate-JIRA] Commented: (HHH-1852) @MappedSuperclass - PropertyAccessException
by Carlo Luib-Finetti (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1852?page=c... ]
Carlo Luib-Finetti commented on HHH-1852:
-----------------------------------------
I forgot to say: I use Hibernate 3.2.5 and Hibernate 3.2.6
> @MappedSuperclass - PropertyAccessException
> -------------------------------------------
>
> Key: HHH-1852
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1852
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Affects Versions: 3.2.0.cr2
> Environment: hibernate-3.2.0.cr2, hibernate-annotations-3.2.0.cr1, hibernate-entitymanager-3.2.0.cr1
> Reporter: David de Mingo
> Attachments: src.zip
>
>
> Caused by: org.hibernate.PropertyAccessException: could not get a field value by reflection getter of org.endea.model.product.ProductAttribute.data
> at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:35)
> at org.hibernate.property.DirectPropertyAccessor$DirectGetter.getForInsert(DirectPropertyAccessor.java:40)
> at org.hibernate.tuple.AbstractEntityTuplizer.getPropertyValuesToInsert(AbstractEntityTuplizer.java:264)
> ...
> Caused by: java.lang.IllegalArgumentException
> at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:37)
> at sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:18)
> at java.lang.reflect.Field.get(Field.java:357)
> at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:32)
> ... 41 morer
--
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
18 years, 1 month
[Hibernate-JIRA] Commented: (HHH-1852) @MappedSuperclass - PropertyAccessException
by Carlo Luib-Finetti (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1852?page=c... ]
Carlo Luib-Finetti commented on HHH-1852:
-----------------------------------------
I had the same error while executing a HQL query which gives a scalar result (no entity). The query was successfully executed on the database, and then in the process of resolving the query results, Hibernate ran into that error.
What I can see in the debugger is that DirectPropertyAccessor$DirectGetter.get() throws an IllegalArgumentException; the causing Field is the "id" field of my base entity class (@MappedSuperClass) of the entity under inspection.
I solved this problem with a workaround: I changed the query from HQL to a native SQL query (gently using the generated SQL from Hibernate's translation of my HQL -:))
> @MappedSuperclass - PropertyAccessException
> -------------------------------------------
>
> Key: HHH-1852
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1852
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Affects Versions: 3.2.0.cr2
> Environment: hibernate-3.2.0.cr2, hibernate-annotations-3.2.0.cr1, hibernate-entitymanager-3.2.0.cr1
> Reporter: David de Mingo
> Attachments: src.zip
>
>
> Caused by: org.hibernate.PropertyAccessException: could not get a field value by reflection getter of org.endea.model.product.ProductAttribute.data
> at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:35)
> at org.hibernate.property.DirectPropertyAccessor$DirectGetter.getForInsert(DirectPropertyAccessor.java:40)
> at org.hibernate.tuple.AbstractEntityTuplizer.getPropertyValuesToInsert(AbstractEntityTuplizer.java:264)
> ...
> Caused by: java.lang.IllegalArgumentException
> at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:37)
> at sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:18)
> at java.lang.reflect.Field.get(Field.java:357)
> at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:32)
> ... 41 morer
--
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
18 years, 1 month
[Hibernate-JIRA] Updated: (HHH-1268) Unidirection OneToMany causes duplicate key entry violation when removing from list
by Gail Badner (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1268?page=c... ]
Gail Badner updated HHH-1268:
-----------------------------
Assignee: Gail Badner
Fix Version/s: 3.3
3.2.x
> Unidirection OneToMany causes duplicate key entry violation when removing from list
> -----------------------------------------------------------------------------------
>
> Key: HHH-1268
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1268
> Project: Hibernate3
> Issue Type: Bug
> Affects Versions: 3.1
> Environment: 3.1 final
> MySql 4.1.14 using MYISAM tables
> Reporter: Rex Madden
> Assignee: Gail Badner
> Fix For: 3.2.x, 3.3
>
> Attachments: src.zip
>
>
> Simple OneToMany parent/child relationship using the default table structure (2 tables and a join table)
> Add 3 children to the parent. Flush. Remove the first child. Flush throws error:
> Exception in thread "main" org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
> at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:69)
> at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
> at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:202)
> at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:230)
> at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:143)
> at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
> at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:980)
> at UnidirectionalOneToManyRemoveFromListBug.main(UnidirectionalOneToManyRemoveFromListBug.java:27)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86)
> Caused by: java.sql.BatchUpdateException: Duplicate key or integrity constraint violation, message from server: "Duplicate entry '5' for key 2"
> at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1461)
> at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
> at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
> ... 11 more
> The problem is that there is a unique key on the relationship table that gets violated. The session removes the last row in the relationship table, then attempts to rewrite the child_id's. It fails since there is a uniqueness constraint on that column.
--
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
18 years, 1 month