[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2959) Using Map causes unaltered relationships in cache to be flushed
Aaron Luchko (JIRA)
noreply at atlassian.com
Tue Nov 20 03:12:00 EST 2007
Using Map causes unaltered relationships in cache to be flushed
---------------------------------------------------------------
Key: HHH-2959
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2959
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.5
Environment: hibernate-3.2.1, hibernate-3.2.5, hibernate-annotations-3.2.1, hibernate-annotations-3.3.0.GA, multiple databases
Reporter: Aaron Luchko
Attachments: hibMapBug.zip
I've found an issue with associations involving Maps.
Essentially we save a number of entities with associations involving Maps, then save all our changes and commit.
Once everything is saved and committed we start a new transaction and make a trivial change, we save the altered object and the relationship defined via the Map is recreated for every entity still in the cache. With a large cache this becomes a significant performance concern as we're performing O()N database operations every time we commit a transaction.
At the end when one would expect to see
Final Save
01:07:31,341 DEBUG org.hibernate.SQL:401 - update Foo set description=? where id=?
instead the output is
Final Save
01:07:31,341 DEBUG org.hibernate.SQL:401 - update Foo set description=? where id=?
01:07:31,345 DEBUG org.hibernate.SQL:401 - delete from Foo_Bar where Foo_id=?
01:07:31,349 DEBUG org.hibernate.SQL:401 - delete from Foo_Bar where Foo_id=?
01:07:31,351 DEBUG org.hibernate.SQL:401 - delete from Foo_Bar where Foo_id=?
01:07:31,353 DEBUG org.hibernate.SQL:401 - insert into Foo_Bar (Foo_id, mapkey, bars_id) values (?, ?, ?)
01:07:31,353 DEBUG org.hibernate.SQL:401 - insert into Foo_Bar (Foo_id, mapkey, bars_id) values (?, ?, ?)
01:07:31,353 DEBUG org.hibernate.SQL:401 - insert into Foo_Bar (Foo_id, mapkey, bars_id) values (?, ?, ?)
--
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.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list