• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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.



 
Is this the real life? Is this just fantasy? Is this a tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic