Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

result of the setter methods in EntityBeans

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
In entity beans when a setXXX() is called by client for some persistent field, what will happen? Will it write the change immediatly to the database? Immediatly after the completion of the method, will the bean and the database will have the new value specified in this method? Are they not much different than the business methods of entity beans? Pls let me know.
thanks,
Phani
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is up to the Container provider to decide which techniques it adopts regarding the persistency of the cmp fields.
You can read the Section 10.4.2.1 of the EJB spec 2.0 to discover what the spec really mandates.
For instance, BEA Weblogic Server 7.0 SP2 first stores the value of the CMP field within an attribute of the custom generated class that extends your Entity Bean for quick retrieval. It then registers the bean with the RDBMSPersistenceManager to notify the latter that the bean has changed. The PersistenceManager then obtains a transaction and registers the bean with the EntityManager. The databse is then updated accordingly.
I hope it helps
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is also important to keep in mind that when the container chooses to write to the database is only one part of the problem. It also has to decide when to do the commit, which can't happen until the end of the transaction. If you set multiple fields on the same instance within a single transaction, theoretically the container could choose to do multiple writes, but only one commit. In practice, you'll often see the field updates handled in a single database write.
 
Phanindra Nayani
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thankyou Both !!!
 
A berm makes a great wind break. And we all like to break wind once in a while. Like this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic