batch / bulk insert/update in jpa/hibernate with flush and clear

For JPA use entity manager to do flush/clear For hibernate basically just switch the entity manager with hibernate session. When making new objects persistent flush() and then clear() the session regularly in order to control the size of the first-level cache. The suggest batch size is 20-50 by hibernate. However I found 1500 is good…

that=this in javascript

Watch Out: Callbacks And Closures Sometimes Do Not Play Nicely  Of course there are always gotchas with JavaScript. Lets define a callback function: 1 2 3 4 5 6 7 8 9 10 11 var createCallBack = function() { //First function return new function() { //Second function this.message = “Hello World”; return function() {…