This week's giveaway is in the Spring forum. We're giving away four copies of liveProject: Protecting User Data with Spring Security and OAuth2 and have Laurentiu Spilca on-line! See this thread for details.
I have been reading HF EJB.
I was reading about entity beans and I found that with entity beans you can have business methods in the entity bens remote home interface and the advantage is for doing "batch updates".
advantage is for doing Batch Updates
This is the thing that I dont upderstand. Batch updates means you are updating the database through a business method but how this batch updates can be achieved.
I know one mechanism of batch updates is by using the PreparedStatement. But as with CMP we dont use JDBC code how this batch updates can be achieved.
Since this post is under SCBCD I suppose that you are preparing for the exam.. In order not be surprised when you go for the examination, the exam is targeted on EJB 3 and not EJB 2 that HF EJB is focused. Regarding your question the following is taken from EJB 3 by Orreily
FlushModeType.COMMIT makes sense for performance reasons. The best way to tune a database application is to remove unnecessary calls to the database. Some vendor implementations will do all required updates with a batch JDBC call. If the updateBeds( ) method used the default, FlushModeType.AUTO , then an SQL UPDATE would happen when each query executed. Using COMMIT allows the entity manager to execute all updates in one huge batch. Also, an UPDATE usually ends up in the row being write-locked. Using COMMIT limits the amount of time the transaction holds on to this database lock by holding it only for the duration of the JTA commit.