[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5935) stateless session does not commit in batches by default, it commits one by one
radhakrishna (JIRA)
noreply at atlassian.com
Fri Feb 25 10:33:08 EST 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=40078#action_40078 ]
radhakrishna commented on HHH-5935:
-----------------------------------
Can you atleast add a insertAll(entities) or saveOrUpdateAll(entities) that does it in batches, otherwise there is no use of statelessSession for improving performance and remove this section:
http://docs.jboss.org/hibernate/core/3.3/reference/en/html/batch.html#batch-statelesssession
> stateless session does not commit in batches by default, it commits one by one
> ------------------------------------------------------------------------------
>
> Key: HHH-5935
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5935
> Project: Hibernate Core
> Issue Type: Sub-task
> Affects Versions: 3.2.2
> Reporter: radhakrishna
>
> execute(new StatelessHibernateCallback<T>() {
> public T doInStatelessSession(StatelessSession statelessSession) {
>
> for(Entity entity : entitiesBatch){
> statelessSession.insert(entity);
> }
>
> return null;
> }
> });
> inserts entity by entity which is completely ABSURD. Should'nt it insert all of them or none, rather it is inserting one by one by default. I have been using this to insert millions of records assuming it is batching, which is a shame.
--
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