[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:
-----------------------------
Fix Version/s: (was: 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.3.x
>
> 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
17 years, 2 months
[Hibernate-JIRA] Updated: (HHH-1851) relax special handling of 'id' property
by Diego Plentz (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1851?page=c... ]
Diego Plentz updated HHH-1851:
------------------------------
Fix Version/s: (was: 3.2.2)
3.4
> relax special handling of 'id' property
> ---------------------------------------
>
> Key: HHH-1851
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1851
> Project: Hibernate3
> Issue Type: Improvement
> Components: query-hql
> Environment: independent, all versions all databases.
> Reporter: Gunther Schadow
> Assignee: Steve Ebersole
> Fix For: 3.4
>
> Attachments: IdClassAndAnotherPropertyNamedId.zip
>
>
> Hibernate has long treated 'id' in a special manner in HQL and Criteria queries. The drawback to this has always been that it effectively means users cannot define non-identifier properties named id and refer to those properties in HQL/Criteria queries.
> Thus, I will change this such that:
> (1) 'id' can still be used to refer to the identifier property, whatever the property's actual name, as long as the entity does not define a non-identitifer property named id.
> (2) if the entity defines a non-identifier property named 'id', using 'id' in HQL or Criteria queries will refer to this non-identifier property; users would need to refer to the identifier property by its actual name.
> FYI, the original reason for this feature was to support entity's which did not define an identifier property at all (users were responsible for managing the ids seperately. That feature was never really recommended and has been deprecated since early in the 3.x development.
--
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
17 years, 3 months
[Hibernate-JIRA] Created: (HBX-974) Unable to recreate tables using Hibernate
by sridhar negi (JIRA)
Unable to recreate tables using Hibernate
------------------------------------------
Key: HBX-974
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-974
Project: Hibernate Tools
Issue Type: Task
Environment: Oracle 9i.
Reporter: sridhar negi
i m using SchemaUpdate tool of Hibernate.The problem which i m facing is that i had some tables in the database ,now i needed to delete some of the columns from some of the tables. Since UpdateSchema does not allow to delete columns ,i decided to manually drop the those tables from oracle database and recreate those tables. But i m not able to do the same. It tries to fire alter table command, even when there is no such table present in the database..The error whcih i m getting is some thing like this..
[java] alter table POOL_DETAILS add POOL_WEIGHT DOUBLE PRECISION
[java] 52085 DEBUG [main] hbm2ddl.SchemaUpdate - execute alter table POOL_DETAILS add POOL_WEIGHT DOUBLE PRECISION
[java] 52147 ERROR [main] hbm2ddl.SchemaUpdate - execute Unsuccessful: alter table POOL_DETAILS add POOL_WEIGHT DOUBLE PRECISION
[java] 52147 ERROR [main] hbm2ddl.SchemaUpdate - execute ORA-00942: table or view does not exist
--
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
17 years, 3 months
[Hibernate-JIRA] Created: (HBX-954) Failing detection of Sequences?
by Vincent Latombe (JIRA)
Failing detection of Sequences?
-------------------------------
Key: HBX-954
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-954
Project: Hibernate Tools
Issue Type: Bug
Environment: Hibernate3 as provided by Seam 1.2.1GA (dunno which subversion)
Oracle 10g
Reporter: Vincent Latombe
Here is my problem : I used reverse engineering to get an entity from a table in a database.
I got my entity then I wanted to add a generation for the Id. Fine, I add HIBERNATE_SEQUENCE which is needed then I add the annotation to my entity.
I get this :
@Id
@Column(name = "ID", precision = 22, scale = 0)
@GeneratedValue(strategy=GenerationType.SEQUENCE)
@NotNull
public long getId() {
return this.id;
}
Nothing really difficult. Then I try to deploy my ejb using the validate strategy of hbm2ddl. And it fails because it can't find the sequence ([DatabaseMetadata] table not found: TESTSEAM.hibernate_sequence)... Ok strange. Then I switch to the update strategy... Now I get something interesting.
14:40:12,843 INFO [DatabaseMetadata] table not found: TESTSEAM.hibernate_sequence
14:40:12,843 INFO [DatabaseMetadata] table not found: hibernate_sequence
14:40:12,875 ERROR [SchemaUpdate] Unsuccessful: create sequence TESTSEAM.hibernate_sequence
14:40:12,875 ERROR [SchemaUpdate] ORA-00955: ce nom d'objet existe dÚjÓ
14:40:12,875 INFO [SchemaUpdate] schema update complete
It seems that DatabaseMetadata try to lookup a table instead of a sequence, so it can't detect the already existing sequence. So then it tries to create the sequence but it already exists. Any clue?
--
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
17 years, 3 months