2 Replies Latest reply on Aug 8, 2002 6:49 AM by Sacha Labourey

    Entity Bean Clustering

    Péter Vary Newbie

      I've just bought the JBoss Clustering doumentation from Flashline. It says for Entity Beans: "Clustered Entity Beans do not currently have a distirbuted locikng mechenism or a distributed cache". Does it mean, that every time when I want to use an entity bean I have to check the data in the database, weather it changed, or not? In this way loosing the coolest feature of the Entity Beans working as cache?

        • 1. Re: Entity Bean Clustering
          Micah Richert Newbie

          Not only that, but doesn't it mean that there is an integrity issue? For example, if two instances of the same entity bean on two different servers are updated after each bean has already called ejbload, then when each call ejbStore, the bean that calls ejbStore first loses all of it's changes. This is because the second bean to call ejbStore overwrites the information stored by the first.

          So the order of execution would be something like this:
          Server 1, calls ejbLoad for PK=1 on the example bean
          Server 2, calls ejbLoad for PK=1...
          Server 1, bean PK=1 is updated
          Server 2, bean PK=1 is updated with different values from Server 1
          Server 1, ejbStore is called
          Server 2, ejbStore is called and all updates from Server 1 loses all information.

          • 2. Re: Entity Bean Clustering
            Sacha Labourey Master

            integrity problem: NO! we use pessimistic locking at the db level (select for update).

            no cache: yes, it is a performance issue. It is the way most app server do it though (even Weblogic).

            You want a distributed cache? use one. Go on JBoss partner page, you will find two partners offering such a framework for JBoss.

            Cheers,


            Sacha