use stateless session with batch insert

On Sun, Sep 1, 2013 at 5:00 PM, Nicolas Vinot <[email protected]>wrote:

> Le dimanche 01 septembre 2013 22:47:30 Maximilian Haru Raditya a écrit :
> > I'm not quite sure with what you really want.
> > Do you want to:
> > *a) use a new session for each CreateBar() operation
> > *OR
> > *b) use only a single session for all CreateBar() operations*?
>
> In real application, I create one session per file parsing, so one session
> for
> all this process :
>  - test existence of the system corresponding to the file (select from
> system
> where some criteria)
>  - create the system if any (insert into system)
>  - create the file (insert into file)
>  - create all the records in the file (~5k of insert into record)
> I parse ~2k of files, so all the app loop ~2k times the process above,
> creating
> ~2k of sessions.
>
> I can't open only one session for all the process because there is 10M of
> records in the session at the end (~8GB), leading to OutOfMemory before the
> end or a very long time commit (time(1*(10M record commit) >> time(2k*(5k
> record commit)) on machine with a lot of RAM.
>
> On the demo app, Foo = System and Bar = Record.
>
> --
> Nicolas Vinot




-- 
Best Regards
Apatira Lookman
+2348028400104

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to