[Hibernate-JIRA] Commented: (HHH-1296) Non lazy loaded List updates done in wrong order, cause exception
by Uwe Schaefer (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1296?page=c... ]
Uwe Schaefer commented on HHH-1296:
-----------------------------------
About "getting this too when I remove() an entry from a List with an @IndexColumn. ":
We´re facing the same serious trouble here. Is it true that using JoinTables to reflect ordered Lists is absolutely not working when using more than 2 references ?
Is there any way to remove uniqueness from the inverseJoinColumn ? Using something like:
@JoinTable(
name = "rel_a_b",
joinColumns = { @JoinColumn(name = "a_uid") },
inverseJoinColumns = { @JoinColumn(name = "b_uid", unique = false) }
)
does not work, but would provide a workaround.
Please Help
> Non lazy loaded List updates done in wrong order, cause exception
> -----------------------------------------------------------------
>
> Key: HHH-1296
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1296
> Project: Hibernate3
> Type: Bug
> Components: core
> Versions: 3.0.5
> Environment: Hibernate 3.0.5 - any database (checked postgres 7/8, mysql 4 & 5, db2 v8)
> NOT using lazy loading - the tx's are wrapped by session beans, so lazy loading is not allowed.
> Reporter: David Birch
> Priority: Critical
>
>
> The logic behind list updates is not quite right, nor was it in v2 (only now i have a DBA who won't let up...)
> The scenario is:
> a bean with list property, and the list has a number of items in it (say 4, index 0-3), an item is then removed (say item at index 2), and the bean is requested to be saved.
> From what i can see in the SQL traces, the same statements are issues whe lazy loading is on or off, they are:
> [18/12/05 19:48:50:766 EST] 00000036 SystemOut O Hibernate: delete from TGE_CLIENT_POLICY where CLIENT_ID=? and POSITION=?
> [18/12/05 19:48:50:766 EST] 00000036 SystemOut O Hibernate: update TGE_CLIENT_POLICY set POLICY_NK=? where CLIENT_ID=? and POSITION=?
> So, i can only assume (as when this fails, the row with index 1 above the removed row is nuked!), hibernate removes the item at index 3, and then copies the value of the item at index 3 onto the row for item at index 2. Fair enough but...
> When i have lazy loading off, i get DB exceptions like
> Duplicate key or integrity constraint violation message from server: "Duplicate entry '1-999999' for key 1"
> so, there is some nasty in there, which is not updating the correct row - this has happened since 2.1.8 that i know of :(
> i will try & look @ the source, but won't get a chance until after xmas...
--
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, 11 months
[Hibernate-JIRA] Commented: (HHH-1268) Unidirection OneToMany causes duplicate key entry violation when removing from list
by Uwe Schaefer (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1268?page=c... ]
Uwe Schaefer commented on HHH-1268:
-----------------------------------
We´re facing the same serious trouble here. Is it true that using JoinTables to reflect ordered Lists is absolutely not working when using more than 2 references ?
Is there any way to remove uniqueness from the inverseJoinColumn ? Using something like:
@JoinTable(
name = "rel_a_b",
joinColumns = { @JoinColumn(name = "a_uid") },
inverseJoinColumns = { @JoinColumn(name = "b_uid", unique = false) }
)
does not work, but would provide a workaround.
Please Help
> 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
> Type: Bug
> Versions: 3.1
> Environment: 3.1 final
> MySql 4.1.14 using MYISAM tables
> Reporter: Rex Madden
> 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, 11 months
[Hibernate-JIRA] Created: (HHH-2338) Hibernate 3.2.1 has a "rollback" after every "commit" statement when c3p0 is enabled
by Lisa Balducci (JIRA)
Hibernate 3.2.1 has a "rollback" after every "commit" statement when c3p0 is enabled
-------------------------------------------------------------------------------------
Key: HHH-2338
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2338
Project: Hibernate3
Type: Bug
Versions: 3.2.1
Environment: Firebird 1.5.3, Hibernate 3.2.1 and c3p0-0.9.1-pre11.jar/c3p0-0.9.0.jar (tried each one)
Reporter: Lisa Balducci
While using p6spy to observe sql statements I noticed, only while c3p0 is enabled, that after every statement/s there is a "commit" and then immediately following a "rollback". This does not occur with any other Hibernate versions only Hibernate 3.2.1, is this the correct behavior?
01-03-2007 11:17:08|0|4|statement|.......... "the statement"
01-03-2007 11:17:08|0|4|commit||
01-03-2007 11:17:08|0|4|rollback||
01-03-2007 11:17:07|0|3|statement|..........
01-03-2007 11:17:07|-1||resultset|.........
01-03-2007 11:17:07|0|3|commit||
01-03-2007 11:17:07|0|3|rollback||
c3p0 properties settings:
hibernate.c3p0.max_size = 10
hibernate.c3p0.min_size = 5
hibernate.c3p0.timeout = 1800
--
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, 11 months
[Hibernate-JIRA] Created: (HHH-2337) Setting session-specific event listeners
by Wouter Lievens (JIRA)
Setting session-specific event listeners
----------------------------------------
Key: HHH-2337
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2337
Project: Hibernate3
Type: Improvement
Components: core
Environment: Hibernate 3.2.0, MySQL 5
Reporter: Wouter Lievens
Priority: Minor
Event listeners can be assigned programmatically to the Configuration object, but not to the Session or SessionFactory object.
I want to be able to assign a new event listener, with different state, each time I create a new Hibernate session (or Factory).
There is a workaround: you can cast the session factory to SessionFactoryImpl and use getEventListeners on that class, but since this is a "hack" it's unwise to leave it at that. The SessionFactory interface could be extended with the method getEventListeners, allowing to modify the EventListeners at that point, but maybe this issue goes deeper than just that.
--
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, 11 months