-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Batch insert not batching
PostPosted: Fri Jun 10, 2005 10:22 am 
Senior
Senior

Joined: Thu May 12, 2005 11:40 pm
Posts: 125
Location: Canada
Versions:
Hibernate 3.0.5, jTDS 1.0.3, c3p0 0.9.0-pre6

Mapping documents:
<property name="hibernate.jdbc.batch_size">10</property>
<property name="hibernate.jdbc.batch_versioned_data">true</property>

Name and version of the database you are using:
SQL Server 2000 SP3

Debug level Hibernate log excerpt:
DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
Hibernate: insert into ITEM (...) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
DEBUG - preparing statement
DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG - closing statement
DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
Hibernate: insert into ITEM_TEST (TEST_ID, TEST_REQUIRED_FLAG, TEST_STATE_ID, ITEM_ID) values (?, ?, ?, ?)
DEBUG - preparing statement
DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG - closing statement
DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
Hibernate: insert into ITEM_TEST (TEST_ID, TEST_REQUIRED_FLAG, TEST_STATE_ID, ITEM_ID) values (?, ?, ?, ?)
DEBUG - preparing statement
DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG - closing statement
DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
Hibernate: insert into ITEM_TEST (TEST_ID, TEST_REQUIRED_FLAG, TEST_STATE_ID, ITEM_ID) values (?, ?, ?, ?)
DEBUG - preparing statement
DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG - closing statement

As you can see, my batch inserts are not batching. I've been through the Hibernate, jTDS and c3p0 docs and I can't see anything that would prevent this from working. The parent entity (ITEM) is versioned, but as you can see, batch versioned updates are enabled, and it's not the one that should be batched anyway. The association (to ITEM_TEST, the child entity) is mapped using @OneToMany(..., cascade=CascadeType.ALL). There is actually more than one such association leading away from ITEM; this is just one of them. I tried disabling cascades on all but one but it didn't help.

Can inserts resulting from cascades be batched? If so, what am I doing wrong?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 10, 2005 1:30 pm 
Senior
Senior

Joined: Thu May 12, 2005 11:40 pm
Posts: 125
Location: Canada
http://opensource.atlassian.com/project ... owse/HHH-1

Not possible I guess.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.