Felipe Oriani
2017-07-07 14:22:26 UTC
Hello guys.
I am developing a process where we need to insert more than 200.000 records
on the database and it can increse. To have a performance, we need to
implement a stateless session to insert all the data.
The problem is that on our Repositories implementations we depend on the
SessionFactory which contains a session on bind and we take it from
SessionFactory.GetCurrentSession() and depending on the context, it already
has an active transaction.
My question is: Is there any way to implement bulk insert operations on the
normal Session instead of Stateless session?
If no, I would like to know, if is there any way to open a Stateless
session to perform the bulk insert operation for the same transaction? Or
should I need to open a stateless session from my sessionFactory?
I've seen that stateless session can take a DbConnection, so I could try
this:
var statelessSession = factory.OpenStatelessSession(session.Connection);
But I am not sure how it is going to work. If it is fine to and I will get
the same transaction.
Thank you.
--
______________________________________
Felipe B Oriani
***@gmail.com
I am developing a process where we need to insert more than 200.000 records
on the database and it can increse. To have a performance, we need to
implement a stateless session to insert all the data.
The problem is that on our Repositories implementations we depend on the
SessionFactory which contains a session on bind and we take it from
SessionFactory.GetCurrentSession() and depending on the context, it already
has an active transaction.
My question is: Is there any way to implement bulk insert operations on the
normal Session instead of Stateless session?
If no, I would like to know, if is there any way to open a Stateless
session to perform the bulk insert operation for the same transaction? Or
should I need to open a stateless session from my sessionFactory?
I've seen that stateless session can take a DbConnection, so I could try
this:
var statelessSession = factory.OpenStatelessSession(session.Connection);
But I am not sure how it is going to work. If it is fine to and I will get
the same transaction.
Thank you.
--
______________________________________
Felipe B Oriani
***@gmail.com
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhusers+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhusers+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.