Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

EJB 2.x - Remote vs Local lookup and usage

Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Application Architecture is like:

The DAO is present for loose coupling between Business and DataBase. The various DAO Implementations, which we could plug in:
  • CMP Entity Beans for DAO Implementation (using either of Remote/Local interfaces) <- This being the concern area.
  • JDBC for DAO Implementation

  • - There are no Web Module in the application

    1) Is it possible to look up a Entity Local Home from the POJO Business Utility, which is also deployed as a dependent jar file? If Yes, how?
    (It is possible to do so from an EJB or a Web Cointainer, by the use of ejb-local-ref in the Container deployment descriptor).

    2) In a Clustered enviornment, if two threads (on different cluster) are accessing the same Entity data row for updation, is there a possibility of compromising Data Integrity (Assuming Isolation Level is set as Cursor Stability i.e level 2).
    Ranch Hand
    Posts: 186
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    In my opinion...

    1) Yes, but generally a bad idea - use a session bean facade to encapsulate access to the entity bean.

    2) Dependant on the locking mechanism used by the container -> database. If you are using a facade the container will only let one thread be in a session bean method at any one time (assuming both are calling the bean from the same remote reference).
    Sasparilla and fresh horses for all my men! You will see to it, won't you tiny ad?
    Thread Boost feature
      Bookmark Topic Watch Topic
    • New Topic