-->
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.  [ 3 posts ] 
Author Message
 Post subject: StatelessSession and batch JDBC inserts
PostPosted: Fri Dec 15, 2006 3:30 pm 
Newbie

Joined: Mon Jun 12, 2006 7:25 pm
Posts: 7
I'm using Hibernate 3.2 and StatelessSession interface. I set the jdbc batch size to 50.

In a for loop, I insert objects to the Oracle database. My question is, does the StatelessSession interface support JDBC batch processing?

I read the documentation about batch processing and the example given there only used the regular Session interface.

If I use the StatelessSession, will my inserts be put in a batch and will the "hibernate.jdbc.batch_size" parameter will be used to define the batch size?

Thanks,
Ali


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 15, 2006 3:33 pm 
Newbie

Joined: Thu Nov 09, 2006 8:46 pm
Posts: 7
I think YES


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 15, 2006 3:46 pm 
Newbie

Joined: Mon Jun 12, 2006 7:25 pm
Posts: 7
Is there a more definite answer?

When I turned on the statistics, I see this:

11:03:43,823 INFO StatisticsImpl:471 - statements prepared: 50683
11:03:43,823 INFO StatisticsImpl:472 - statements closed: 50683

This is definitely less than what I write to db. But does that mean hibernate used batching while inserting? Also doesn't hibernate use prepared statements and does this mean that hibernate created that many prepared statements? I'd expect at most 1 prepared statement since I insert objects of same class.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.