Caching of BMP's

Discussions

EJB design: Caching of BMP's

  1. Caching of BMP's (3 messages)

    Hi,
    I wanted to know if WebLogic caches BMP Entity beans. If not why.

    Rakesh.

    Threaded Messages (3)

  2. Caching of BMP's[ Go to top ]

    I don't think Weblogic caches BMP entity beans, or for that matter, any entity beans. The basic reason is: Weblogic has to make sure that the data contained in the beans are current (meaning in sync with the database). So whenever you access any entity bean, before your method gets called, the ejbLoad() method gets called first to make sure of this. Now, if your data doesn't change that often, you can use read-only entity beans. Read-only entity beans are cached and only gets updated every so often (this you have to specify). An example:

      <weblogic-enterprise-bean>
        <ejb-name>PersonEn</ejb-name>
        <entity-descriptor>
          <entity-cache>
            <read-timeout-seconds>0</read-timeout-seconds>
            <concurrency-strategy>ReadOnly</concurrency-strategy>
          </entity-cache>
          ...
      </weblogic-enterprise-bean>

    When you specify your bean as read-only, Weblogic blindly assumes that the data never change. The read-timeout-seconds specify the time when you want your beans updated. If you set this to 0, your beans will never be updated until you restart your server.

    Regards,

    Marco
  3. Caching of BMP's[ Go to top ]

    It depends on the commit option you choose. With commit option A, the container will cache EB between transactions.
    'Commit Option' goes by different names in different AppServer configurations.

    Pranab
  4. Caching of BMP's[ Go to top ]

    What's commit option?