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
signature.asc
Description: This is a digitally signed message part.
