-->
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.  [ 9 posts ] 
Author Message
 Post subject: batch_size doesnt work?
PostPosted: Mon Feb 11, 2008 11:13 am 
Newbie

Joined: Wed Apr 11, 2007 5:08 pm
Posts: 3
Hi

I try to use hibernate.adonet.batch_size for batched inserts

something like

while {
Obj o = new Obj();
session.Save(o);
}
session.Flush();


but every single call of session.Save runs a SQL-insert in the database

any ideas???


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 11, 2008 11:06 pm 
Regular
Regular

Joined: Tue Dec 25, 2007 3:41 pm
Posts: 57
Location: Argentina
Are you using SQL Server ? Because it's only supported currently

_________________
Dario Quintana


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 20, 2008 11:32 am 
Newbie

Joined: Wed Apr 11, 2007 5:08 pm
Posts: 3
yes. sql server 2005


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 9:23 am 
Regular
Regular

Joined: Wed Oct 25, 2006 10:51 pm
Posts: 71
Actually, I can't really say whether it's working for me either.

The documentation is pretty brief:
http://www.hibernate.org/hib_docs/nhibe ... ch-updates

I wonder if you need to call 'Save' or 'Update' on each object to get this to work? Or am I missing something?


Last edited by PandaWood on Sat Jul 12, 2008 10:21 am, edited 3 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 9:44 am 
Regular
Regular

Joined: Wed Jan 25, 2006 1:11 am
Posts: 118
Location: Copenhagen, Denmark
Take a look in your log4net log for nHibernate is it infact the BatcherImpl that is running the queries?

Where do you have your configurationsettings?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 10:33 am 
Regular
Regular

Joined: Wed Oct 25, 2006 10:51 pm
Posts: 71
Hi,

I can see that BatcherImpl is doing something ;-)

But then again, I'm not sure precisely, what batching is supposed to be doing?

01:22:40.352 [6] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - Updating entity: [Bla.DomainModel.Bla.Account#15]
01:22:40.352 [6] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - Existing version: 19 -> New Version: 20
01:22:40.352 [6] DEBUG NHibernate.Impl.BatcherImpl - Opened new IDbCommand, open IDbCommands: 1
01:22:40.352 [6] DEBUG NHibernate.Impl.BatcherImpl - Building an IDbCommand object for the SqlString: UPDATE Account SET Version = ?, Name = ?, Baskets = ?, Amount = ?, Fee = ?, Interest = ?, Closed = ?, Out = ?, Loan = ?, Tra = ?, EntityID = ?, AdviserID = ?, Interest = ? WHERE id = ? AND Version = ?
01:22:40.352 [6] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - Dehydrating entity: [Bla.DomainModel.Bla.Account#15]
01:22:40.352 [6] DEBUG NHibernate.Type.Int32Type - binding '20' to parameter: 0
01:22:40.352 [6] DEBUG NHibernate.Type.StringType - binding '004' to parameter: 1
01:22:40.352 [6] DEBUG NHibernate.Type.Int32Type - binding '38' to parameter: 2
01:22:40.352 [6] DEBUG NHibernate.Type.DecimalType - binding '150000.0000' to parameter: 3
01:22:40.352 [6] DEBUG NHibernate.Type.DecimalType - binding '-0.0250' to parameter: 4
01:22:40.352 [6] DEBUG NHibernate.Type.DecimalType - binding '-0.1390' to parameter: 5
01:22:40.352 [6] DEBUG NHibernate.Type.BooleanType - binding 'True' to parameter: 6
01:22:40.352 [6] DEBUG NHibernate.Type.BooleanType - binding 'False' to parameter: 7
01:22:40.352 [6] DEBUG NHibernate.Type.DecimalType - binding '176066.6200' to parameter: 8
01:22:40.352 [6] DEBUG NHibernate.Type.Int32Type - binding '8' to parameter: 9
01:22:40.352 [6] DEBUG NHibernate.Type.Int32Type - binding '15' to parameter: 10
01:22:40.352 [6] DEBUG NHibernate.Type.Int32Type - binding '16' to parameter: 11
01:22:40.352 [6] DEBUG NHibernate.Type.Int32Type - binding '5' to parameter: 12
01:22:40.352 [6] DEBUG NHibernate.Type.Int32Type - binding '15' to parameter: 13
01:22:40.352 [6] DEBUG NHibernate.Type.Int32Type - binding '19' to parameter: 14
01:22:40.352 [6] DEBUG NHibernate.SQL - UPDATE Account SET Version = @p0, Name = @p1, Baskets = @p2, Subscription= @p3, Fee = @p4, Interest = @p5, Closed = @p6, Par = @p7, Loan = @p8, Tra = @p9, EntityID = @p10, AdviserID = @p11, Interest = @p12 WHERE id = @p13 AND Version = @p14; @p0 = '20', @p1 = '004', @p2 = '38', @p3 = '150000.0000', @p4 = '-0.0250', @p5 = '-0.1390', @p6 = 'True', @p7 = 'False', @p8 = '176066.6200', @p9 = '8', @p10 = '15', @p11 = '16', @p12 = '5', @p13 = '15', @p14 = '19'
01:22:40.368 [6] DEBUG NHibernate.Impl.BatcherImpl - Closed IDbCommand, open IDbCommands: 0


Last edited by PandaWood on Sat Jul 12, 2008 10:19 am, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 26, 2008 5:44 pm 
Newbie

Joined: Thu Jun 26, 2008 5:34 pm
Posts: 1
It doesn't work for me either... I'm using NHibernate 1.2


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 31, 2008 11:43 pm 
Senior
Senior

Joined: Sat Sep 03, 2005 12:54 am
Posts: 139
Can't seem to get it to work either...anyone had any joy with this?

Jason


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 01, 2008 5:46 am 
Beginner
Beginner

Joined: Tue Mar 27, 2007 4:54 am
Posts: 47
Maybe it works even though you might think it doesn't?
http://groups.google.com/group/nhusers/ ... db66f62a39

At least for me it work perfectly fine.


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