Use batching to allow NHiberante better ways to save data.
If you are calling this in a loop, use stateles session instead.
don't call flush explicitly, call transactin.Commit()

On Sat, Oct 11, 2008 at 1:28 PM, Pedro Santos <[EMAIL PROTECTED]>wrote:

>
> Hello,
>
> I have a batch job that does something like:
>
> for(;;){
>  IList list = LoadSomething();
>  ...
>  Update(obj1);
>  Update(obj2);
>  Update(obj3);
>  Flush();
> }
>
> I do know that the objects to update don't have any dirty relations, I
> just need to store them simple and fast. I've noticed on the NH logs
> that NHibernate does a lot of actions. We did some tests and the NH
> Flush takes about 60ms, while a single straight sql update command
> would take 15ms.
>
> Can I have some advice on the best way to make this job perform
> faster? And any other general guidelines on this example?
>
> Thank you.
>
> --
> Pedro Santos
> Home - http://psantos.zi-yu.com
> Work - http://www.pdmfc.com
> The future - http://www.orionsbelt.eu
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" 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/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to