I can import 6 million records within 10 minutes using a bulk insert on sql server using a five year old standard pc hardware with direkt sql. Using hibernate I want to come close to this. Therefore I try to: 1) use prepared statement (automatically with hibernate, isn't it?) 2) use stateless session for low overhead (see test with stateful and stateless session) 3) use sequence with allocationsize>1 (cannot be configured in the test, it fails then completely) 4) use named query to reduce overhead even more (no exception - runs through - but does not work, see test)
Unfortunately 3) and 4) cannot be used as you can see if you test using the pull request mentioned above. That stateless session is faster than stateful as you can see in the test can be explained. But I think the difference should be smaller. In the end using hibernate I am far away from native sql performance. And if at least an allocationsize of 100 and a namedquery could be used together with a stateless session I would think I should come close to native sql as the managing overhead should be low then. But I cannot successfully configure such a setup.
|