All I want to do is to be able to insert around 10, 000 registers in a batch..
In order to do that I have a loop as follows
foreach(Message m in messages)
{
InsertMessage(m);
}
With my actual implementation, this is done one by one (execute an insert query
one by one).
Note that InsertMessage is (if you desire) a kind of wrapper for a
Message.Create()
So, how do StateLess sessions helps in this case, how does it works?
I have read the link you provided, but i see this <property
name="adonet.batch_size">100</property>
If I am using AR, I mean decoring my clases with properties (not using xml
mapping) where do I must to put this sentence?
Another question, from my "Message" model I want to be able, through AR to
insert inmediately a register if I call Message.Create(), so no batch
will be needed in this case..
So, my question is:
How do I insert records in a batch, but being able to insert inmediatly if
desired?
----- Original Message -----
From: Markus Zywitza
To: [email protected]
Sent: Thursday, June 18, 2009 3:45 AM
Subject: Re: Active Record Bulk Insert
Please read and understand all the test cases. Stateless sessions differ from
regualr ones!
-Markus
2009/6/18 Mauricio Scheffer <[email protected]>
Use a stateless session. See:
http://nhforge.org/blogs/nhibernate/archive/2008/10/30/bulk-data-operations-with-nhibernate-s-stateless-sessions.aspx
ActiveRecord has support for stateless sessions in trunk, see:
http://fisheye2.atlassian.com/browse/castleproject/trunk/ActiveRecord/Castle.ActiveRecord.Tests/StatelessSessionScopeTestCase.cs?r=5747
On Jun 17, 8:22 pm, "[email protected]"
<[email protected]> wrote:
> Anyone has an idea if how can I perform a bulk insert using AR?
> Or what (and how) should I use another thing instead ?
>
> Thx
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---