From: <leg...@at...> - 2004-04-16 15:53:02
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HBI-29 Here is an overview of the issue: --------------------------------------------------------------------- Key: HBI-29 Summary: Optimize Hibernate for the bulk insertion of related entities Type: New Feature Status: Unassigned Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate 1.2 Assignee: Reporter: Bradley Leupen Created: Fri, 16 Apr 2004 10:57 AM Updated: Fri, 16 Apr 2004 10:57 AM Environment: Hibernate 1.2, MySql 3.1 Description: It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2004-04-16 20:42:00
|
The following comment has been added to this issue: Author: Bradley Leupen Created: Fri, 16 Apr 2004 3:46 PM Body: mysql version 4.0.1, not 3 --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HBI-29?page=comments#action_12893 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HBI-29 Here is an overview of the issue: --------------------------------------------------------------------- Key: HBI-29 Summary: Optimize Hibernate for the bulk insertion of related entities Type: New Feature Status: Unassigned Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate 1.2 Assignee: Reporter: Bradley Leupen Created: Fri, 16 Apr 2004 10:57 AM Updated: Fri, 16 Apr 2004 3:46 PM Environment: Hibernate 1.2, MySql 3.1 Description: It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2004-08-17 20:32:17
|
The following comment has been added to this issue: Author: Dave G Created: Tue, 17 Aug 2004 3:27 PM Body: Here is the difference between Hibernate's current batch SQL feature and a feature that is highly desirable. HIBERNATE 1.2 CURRENT BATCH UPDATE: CURRENT - update n rows requires n SQL statements Currently, Hibernate batch feature simply batch many SQL atatements into 1 JDBC call which provides only marginally performance improvement compared to issuing 1 UPDATE statement for all rows. supports the update of n rows via n SQL statements. For example, to update 1 field in 15,000 rows, you must read 15,000 rows into transfer objects using Session, update the 15,000 objects in memory and then perform a Collection update using the Session, which results (in the end) in 15,000 SQL statements of the form UPDATE SET FIELDXYZ = valuexyz WHERE pk = pkvalue. While okay for small result sets, this solution does not scale well for large databases. SUGGESTED FUTURE HIBERNATE ENHANCEMENT - BATCH UPDATES Update n rows requires **** ONE **** SQL statement * This feature would allow you to (1 or more) fields using a filter. This solution would scale better for isolated batch update scenarios. UPDATE table SET FIELD1 WHERE field2=somevalue --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HBI-29?page=comments#action_14157 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HBI-29 Here is an overview of the issue: --------------------------------------------------------------------- Key: HBI-29 Summary: Optimize Hibernate for the bulk insertion of related entities Type: New Feature Status: Closed Priority: Minor Resolution: CANNOT REPRODUCE Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate 1.2 Assignee: Reporter: Bradley Leupen Created: Fri, 16 Apr 2004 10:57 AM Updated: Tue, 17 Aug 2004 3:27 PM Environment: Hibernate 1.2, MySql 3.1 Description: It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2004-08-17 22:58:50
|
Message: The following issue has been closed. Resolver: Max Rydahl Andersen Date: Tue, 17 Aug 2004 3:03 PM I fail to see whats different between this kind of batching and what hibernate does at the moment...(mainly only sending sql to the database when needed and thus batching it) Bring it up again in (H2 or H3) if you think there are more to it ;) --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HBI-29 Here is an overview of the issue: --------------------------------------------------------------------- Key: HBI-29 Summary: Optimize Hibernate for the bulk insertion of related entities Type: New Feature Status: Closed Priority: Minor Resolution: CANNOT REPRODUCE Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate 1.2 Assignee: Reporter: Bradley Leupen Created: Fri, 16 Apr 2004 10:57 AM Updated: Tue, 17 Aug 2004 3:03 PM Environment: Hibernate 1.2, MySql 3.1 Description: It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2004-08-18 12:51:45
|
The following comment has been added to this issue: Author: Bradley Leupen Created: Wed, 18 Aug 2004 8:18 AM Body: here is the difference between the feature request and hibernate's current batching implementation (dont know about 3.0): the current hibernate implementation allows batching only when the same sql statement is generated in succession. this is fine for trivial entites but is useless for inserting a large number of related entities with cascade update = true (given relationship pairs A --- B, hibernate issues separate sql insert statements for A and B for every insert, thus breaking the batch). this restriction essentially forces the user to choose between the convenience of the auto-update feature and (roughly) an order of magnitude increase in performance. the intelligence of the batcher could be greatly increased if its api were extended to support the insert or update of a collection of persistent entities. not only would this solve the auto-update problem but would also allow the efficient insert/update of many disparate entities in one transaction. --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HBI-29?page=comments#action_14168 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HBI-29 Here is an overview of the issue: --------------------------------------------------------------------- Key: HBI-29 Summary: Optimize Hibernate for the bulk insertion of related entities Type: New Feature Status: Closed Priority: Minor Resolution: CANNOT REPRODUCE Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate 1.2 Assignee: Reporter: Bradley Leupen Created: Fri, 16 Apr 2004 10:57 AM Updated: Wed, 18 Aug 2004 8:18 AM Environment: Hibernate 1.2, MySql 3.1 Description: It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2004-08-21 20:58:12
|
Message: The following issue has been reopened. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HBI-29 Here is an overview of the issue: --------------------------------------------------------------------- Key: HBI-29 Summary: Optimize Hibernate for the bulk insertion of related entities Type: New Feature Status: Reopened Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate 1.2 Assignee: Reporter: Bradley Leupen Created: Fri, 16 Apr 2004 10:57 AM Updated: Sat, 21 Aug 2004 4:25 PM Environment: Hibernate 1.2, MySql 3.1 Description: It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2004-08-22 12:33:03
|
The following issue has been updated: Updater: Christian Bauer (mailto:chr...@hi...) Date: Sun, 22 Aug 2004 8:00 AM Changes: Component changed to core --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 Here is an overview of the issue: --------------------------------------------------------------------- Key: HHH-1 Summary: Optimize Hibernate for the bulk insertion of related entities Type: New Feature Status: Reopened Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate3 Components: core Assignee: Reporter: Bradley Leupen Created: Fri, 16 Apr 2004 10:57 AM Updated: Sun, 22 Aug 2004 8:00 AM Environment: Hibernate 1.2, MySql 3.1 Description: It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <no...@at...> - 2005-05-20 05:49:17
|
The following comment has been added to this issue: Author: Michael Kopp Created: Fri, 20 May 2005 12:47 AM Body: The priority of this should be increased. I found the original forum entry: http://forum.hibernate.org/viewtopic.php?t=929812 The change would improve real life performance by an order of magnitude. I don't think that this is a minor thing. And it is a pain doing that by hand for a complex model. Are there any intentions on solving that in HB3? --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comments#action_17817 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 Here is an overview of the issue: --------------------------------------------------------------------- Key: HHH-1 Summary: Optimize Hibernate for the bulk insertion of related entities Type: New Feature Status: Reopened Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate3 Components: core Assignee: Reporter: Bradley Leupen Created: Fri, 16 Apr 2004 10:57 AM Updated: Fri, 20 May 2005 12:47 AM Environment: Hibernate 1.2, MySql 3.1 Description: It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <no...@at...> - 2005-05-20 13:22:20
|
The following comment has been added to this issue: Author: Bradley Leupen Created: Fri, 20 May 2005 8:21 AM Body: still waiting patiently. i noticed that spring has exposed a saveUpdate(Collection) method. perhaps they have their eye on this issue. --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comments#action_17822 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 Here is an overview of the issue: --------------------------------------------------------------------- Key: HHH-1 Summary: Optimize Hibernate for the bulk insertion of related entities Type: New Feature Status: Reopened Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate3 Components: core Assignee: Reporter: Bradley Leupen Created: Fri, 16 Apr 2004 10:57 AM Updated: Fri, 20 May 2005 8:21 AM Environment: Hibernate 1.2, MySql 3.1 Description: It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <no...@at...> - 2005-05-20 20:15:16
|
The following comment has been added to this issue: Author: Christian Bauer Created: Fri, 20 May 2005 3:14 PM Body: This will probably not happen without someone providing a patch or sponsoring development. It's secondary functionality (also, insert performance is usually not relevant). --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comments#action_17839 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 Here is an overview of the issue: --------------------------------------------------------------------- Key: HHH-1 Summary: Optimize Hibernate for the bulk insertion of related entities Type: New Feature Status: Reopened Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate3 Components: core Assignee: Reporter: Bradley Leupen Created: Fri, 16 Apr 2004 10:57 AM Updated: Fri, 20 May 2005 3:14 PM Environment: Hibernate 1.2, MySql 3.1 Description: It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <no...@at...> - 2005-05-23 05:35:13
|
The following comment has been added to this issue: Author: Michael Kopp Created: Mon, 23 May 2005 12:34 AM Body: Bradley, I couldn't find the saveUpdate you mentioned; to which class does it belong to. I dearly hope that this will be implemented, as I do not see insert performance as unrelevant. My system inserts a lot of data and updates very few. Most lookups are done shortly after the first insert and thus in the cache. So insert performance is very relevant to me. --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comments#action_17850 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 Here is an overview of the issue: --------------------------------------------------------------------- Key: HHH-1 Summary: Optimize Hibernate for the bulk insertion of related entities Type: New Feature Status: Reopened Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate3 Components: core Assignee: Reporter: Bradley Leupen Created: Fri, 16 Apr 2004 10:57 AM Updated: Mon, 23 May 2005 12:34 AM Environment: Hibernate 1.2, MySql 3.1 Description: It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <no...@at...> - 2005-05-23 12:30:13
|
The following comment has been added to this issue: Author: Bradley Leupen Created: Mon, 23 May 2005 7:29 AM Body: Spring 1.2 (RC 2) has a saveOrUpdateAll(Collection) method defined on the HibernateTemplate class. It's too bad this API change is not on the Hibernate Team's priority list. I have the same problem, where i need to insert (often) tens of thousands of rows in a single transaction. it would be nice to hand a collection of new/dirty entities off to hibernate and let it determine the fastest way possible to save them. --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comments#action_17854 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 Here is an overview of the issue: --------------------------------------------------------------------- Key: HHH-1 Summary: Optimize Hibernate for the bulk insertion of related entities Type: New Feature Status: Reopened Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate3 Components: core Assignee: Reporter: Bradley Leupen Created: Fri, 16 Apr 2004 10:57 AM Updated: Mon, 23 May 2005 7:29 AM Environment: Hibernate 1.2, MySql 3.1 Description: It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <no...@at...> - 2005-05-23 12:36:14
|
The following comment has been added to this issue: Author: Michael Kopp Created: Mon, 23 May 2005 7:35 AM Body: My talking. IMO we should not even need an extra method. The normal cascade could take care of that. --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comments#action_17855 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 Here is an overview of the issue: --------------------------------------------------------------------- Key: HHH-1 Summary: Optimize Hibernate for the bulk insertion of related entities Type: New Feature Status: Reopened Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate3 Components: core Assignee: Reporter: Bradley Leupen Created: Fri, 16 Apr 2004 10:57 AM Updated: Mon, 23 May 2005 7:35 AM Environment: Hibernate 1.2, MySql 3.1 Description: It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <no...@at...> - 2005-05-25 03:32:47
|
The following comment has been added to this issue: Author: Christian Bauer Created: Tue, 24 May 2005 10:32 PM Body: So stop talking and implement it. --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comments#action_17921 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 Here is an overview of the issue: --------------------------------------------------------------------- Key: HHH-1 Summary: Optimize Hibernate for the bulk insertion of related entities Type: New Feature Status: Reopened Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate3 Components: core Assignee: Reporter: Bradley Leupen Created: Fri, 16 Apr 2004 10:57 AM Updated: Tue, 24 May 2005 10:32 PM Environment: Hibernate 1.2, MySql 3.1 Description: It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <no...@at...> - 2005-06-22 14:18:53
|
The following comment has been added to this issue: Author: Aseel Abbas Created: Wed, 22 Jun 2005 9:18 AM Body: We need to insert 10000 objects every 6 seconds. Hibernate takes over 8.5 seconds to do this. Using JDBC with batch insert ( java.sql.PreparedStatement.addBatch(), java.sql.PreparedStatement.excuteBatch()) with 1000 objects per batch, the 10 required transactions happen in under 180ms. So Hibernate is about 40 times slower than JDBC in this case. It would be great if Hibernate had a bulk insert feature. --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comments#action_18457 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 Here is an overview of the issue: --------------------------------------------------------------------- Key: HHH-1 Summary: Optimize Hibernate for the bulk insertion of related entities Type: New Feature Status: Reopened Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate3 Components: core Assignee: Reporter: Bradley Leupen Created: Fri, 16 Apr 2004 10:57 AM Updated: Wed, 22 Jun 2005 9:18 AM Environment: Hibernate 1.2, MySql 3.1 Description: It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <no...@at...> - 2005-06-22 14:24:52
|
The following comment has been added to this issue: Author: Michael Kopp Created: Wed, 22 Jun 2005 9:23 AM Body: Hibernate has a bulk insert feature. That is not the point of this bug. The only thing is that hibernate executes the bulk everytime the entity type changes. which happens all the time in a complex object model. If you only insert 1000 objects of the same type, the normal bulk feature is suffient. read the documentation on how to turn that on. --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comments#action_18458 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 Here is an overview of the issue: --------------------------------------------------------------------- Key: HHH-1 Summary: Optimize Hibernate for the bulk insertion of related entities Type: New Feature Status: Reopened Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate3 Components: core Assignee: Reporter: Bradley Leupen Created: Fri, 16 Apr 2004 10:57 AM Updated: Wed, 22 Jun 2005 9:23 AM Environment: Hibernate 1.2, MySql 3.1 Description: It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <no...@at...> - 2005-08-11 11:05:03
|
The following comment has been added to this issue: Author: Aksel Hilde Created: Thu, 11 Aug 2005 6:04 AM Body: I also have problems understanding why mr. Bauer see this as secondary functionality, in a product being so good at persisting complex object model. For our application (national cadaster system for Norway) this feature is mandatory to be able to improve performance when persisting our object model (which is one of our major bottlenecks at the time). We deal with rather complex transaction, but nothing unusual. --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comments#action_19308 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 Here is an overview of the issue: --------------------------------------------------------------------- Key: HHH-1 Summary: Optimize Hibernate for the bulk insertion of related entities Type: New Feature Status: Reopened Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate3 Components: core Assignee: Reporter: Bradley Leupen Created: Fri, 16 Apr 2004 10:57 AM Updated: Thu, 11 Aug 2005 6:04 AM Environment: Hibernate 1.2, MySql 3.1 Description: It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: Michael K. (JIRA) <no...@at...> - 2006-03-16 15:38:55
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comments#action_22511 ] Michael Kopp commented on HHH-1: -------------------------------- I have a new and rather simple aproach on this on. Hibernate knows how insert are to be ordered. Basically its done during the cascade. SaveEvent: cascadeBeforeSave addInsertAction cascadeAfterSave All we really need is to inform the EntityInsertAction of its parents EntityInsertAction's, thus of the once that have to happen before. The cascadeAfterSave can propergate that down the chain. and the CascadeBeforeSave can give that back. That way the code would know of the EntityInsertActions that the new one is dependent on. Once that is available, the ActionQueue.prepareActions can reorder the insert actions: - first order by EnityType - go through the list and move Entities with Parents to the end of the list - now move all entites with no parents are at the beginning - remove those toplevel entities from the dependent list of the Entities that contain them as parents. - At this point some of these changed Entites have no parents anymore others do. - start at the beginning of the loop: go through the list and move Entities with Parents to the end of the list Do this until no EntityInsertAction has a parent anymore. The resulting order will be valid and the optimum insert order! I might actually sit down and do that, provided that the hibernate guys would be willing to include that change. > Optimize Hibernate for the bulk insertion of related entities > ------------------------------------------------------------- > > Key: HHH-1 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 > Project: Hibernate3 > Type: New Feature > Components: core > Environment: Hibernate 1.2, MySql 3.1 > Reporter: Bradley Leupen > Priority: Minor > > > It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. > Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. -- 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 |
From: Max R. A. (JIRA) <no...@at...> - 2006-03-17 10:46:04
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comments#action_22517 ] Max Rydahl Andersen commented on HHH-1: --------------------------------------- if is documented as actually having an effect and not introduce slower performance for existing normal usage then it would be interesting. (but we are pretty busy at the moment so no promises to when we can get it included..) > Optimize Hibernate for the bulk insertion of related entities > ------------------------------------------------------------- > > Key: HHH-1 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 > Project: Hibernate3 > Type: New Feature > Components: core > Environment: Hibernate 1.2, MySql 3.1 > Reporter: Bradley Leupen > Priority: Minor > > > It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. > Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. -- 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 |
From: Michael K. (JIRA) <no...@at...> - 2006-04-28 18:12:36
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comments#action_22901 ] Michael Kopp commented on HHH-1: -------------------------------- Ok I have it and It is actually so simple its real beautiful. All we need is to override the compare method in EntityInsertAction: public int compareTo(Object other) { if (other == this) // always equal return 0; try { final EntityInsertAction entityInsertAction = ((EntityInsertAction) other); final Object instance = entityInsertAction.getInstance(); if (instance != getInstance()) // just to prevent checking on duplicate insert { // if any of our properties is actually to be inserted, it has to be before us for (int i = 0; i < state.length; i++) { final Object rel = state[i]; if (rel != null && rel == instance) return +1; } } } catch (ClassCastException e) { // why would we compare against another object than one with the same type... // but let that be here to catch that off case } // the base compare, sorts first by roleName which effectifly groups the statements by the tables affected return super.compareTo(other); } And then add an option to sort the inserts, like it already exists for updates. This way it cannot have any effect on existing configuration, you actually have to choose it. What it does is: if the entity of the other Action is actually referenced in one of the properties, that other action needs to come first (as they are both inserts). if not we just sort it like updates, which results in grouping by tables. It minimizes the roundtrips to the minimum, exactly like the updates sort does too. Max do you think this change could make it into 3.2, it is a very small change and has no effect if not explicitly turned on. > Optimize Hibernate for the bulk insertion of related entities > ------------------------------------------------------------- > > Key: HHH-1 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 > Project: Hibernate3 > Type: New Feature > Components: core > Environment: Hibernate 1.2, MySql 3.1 > Reporter: Bradley Leupen > Priority: Minor > > > It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. > Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. -- 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 |
From: Max R. A. (JIRA) <no...@at...> - 2006-04-28 18:23:27
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comments#action_22902 ] Max Rydahl Andersen commented on HHH-1: --------------------------------------- create a patch with the option etc. did you try an measure the effect of it too ? > Optimize Hibernate for the bulk insertion of related entities > ------------------------------------------------------------- > > Key: HHH-1 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 > Project: Hibernate3 > Type: New Feature > Components: core > Environment: Hibernate 1.2, MySql 3.1 > Reporter: Bradley Leupen > Priority: Minor > > > It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. > Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. -- 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 |
From: Michael K. (JIRA) <no...@at...> - 2006-04-28 18:45:25
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comments#action_22903 ] Michael Kopp commented on HHH-1: -------------------------------- Should I create a patch on the current 3.2 cvs branch, right? I do not have messures for it in hibernate, but I do for our code which does this on its own. Meaning our project, has turned of save-update cascades on the critical places and calls save in the correct order. We had a performance increased by a facter of 10-15 (1000-1500%) depending on the size of the object tree. Its really simple, instead of nearly as much 'BatchInserts' as we had entities (500-600) we came down to about 5 BatchInserts at all times, as this is the number of entity types involved. I'm not in my office this next week, so i'll do it the week after. I will create the patch and will of course check the effect it has on our application (of course after I removed our custom code). If it has indeed the desired results I will submit it here. > Optimize Hibernate for the bulk insertion of related entities > ------------------------------------------------------------- > > Key: HHH-1 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 > Project: Hibernate3 > Type: New Feature > Components: core > Environment: Hibernate 1.2, MySql 3.1 > Reporter: Bradley Leupen > Priority: Minor > > > It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. > Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. -- 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 |
From: Budhaditya (JIRA) <no...@at...> - 2006-05-16 14:45:19
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comments#action_23107 ] Budhaditya commented on HHH-1: ------------------------------ Hibernate Bulk Insert is not Working for me..... Hi, I am using hibernate version 3.1.2 spring version 2.0 In my test-beans.xml I have these following entries...... <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> ............ ............ <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop> <prop key="hibernate.hbm2ddl.auto">create</prop> <prop key="hibernate.show_sql">false</prop> <prop key="hibernate.cache.use_second_level_cache">false</prop> <prop key="hibernate.cache.use_query_cache">true</prop> <prop key="hibernate.cache.use_structured_entries">true</prop> <prop key="hibernate.generate_statistics">true</prop> <prop key="hibernate.jdbc.batch_size">35</prop> </props> </property> .................... </bean> Now two important things to note here is 1. hibernate.cache.use_second_level_cache set to false 2. hibernate.jdbc.batch_size set to 35 Now I believe this is all the setting needed. My model names are Components and Process. for Bulk insert I was trying this.... for (int i = 0; i < 1000; i++) { hibernateTemplate.save(components.get(i)); } for (int i = 0; i < 1000; i++) { hibernateTemplate.save(processes.get(i)); } Instead of Single insert like this..... for (int i = 0; i < 1000; i++) { hibernateTemplate.save(components.get(i)); hibernateTemplate.save(processes.get(i)); } My problem is that both way the time taken is the same........... I tried putting trace on SQL database and I dint see any difference in queries also....... Can u please help me and tell me how do I make this Hibernate Bulk Insert Work???? Thanks and waitng in anticipation.... > Optimize Hibernate for the bulk insertion of related entities > ------------------------------------------------------------- > > Key: HHH-1 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 > Project: Hibernate3 > Type: New Feature > Components: core > Environment: Hibernate 1.2, MySql 3.1 > Reporter: Bradley Leupen > Priority: Minor > > > It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. > Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. -- 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 |
From: Christian B. (JIRA) <no...@at...> - 2006-05-16 15:55:20
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comments#action_23108 ] Christian Bauer commented on HHH-1: ----------------------------------- Go to the forum, this has nothing to do with this case. > Optimize Hibernate for the bulk insertion of related entities > ------------------------------------------------------------- > > Key: HHH-1 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 > Project: Hibernate3 > Type: New Feature > Components: core > Environment: Hibernate 1.2, MySql 3.1 > Reporter: Bradley Leupen > Priority: Minor > > > It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. > Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. -- 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 |