Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

Batch updates using home inerface

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
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.

Thanks
 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rakesh,

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.



Regard,
Nicolas
 
rakesh kadulkar
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes I am preparing for SCBCD but for EJB 2.0 and not for EJB 3.0 for some reasons.

And I am not able to understand the answer that has been given.

What I dont unserstand is how batch update can be done using CMP as you will never put the JDBC Code in CMP Entity bean.



 
Every time you till, you lose 30% of your organic matter. But this tiny ad is durable:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic