ReadOnly beans not being cached - Weblogic

This is a discussion on ReadOnly beans not being cached - Weblogic ; Hi, I'm having a problem caching ReadOnly entity beans. Namely, they're not getting cached. The reason I know this is because I've checked my P6Spy logs, and the SQL statement that would get generated for an ejbLoad of my entity ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: ReadOnly beans not being cached

  1. ReadOnly beans not being cached


    Hi,

    I'm having a problem caching ReadOnly entity beans. Namely, they're not getting
    cached. The reason I know this is because I've checked my P6Spy logs, and the
    SQL statement that would get generated for an ejbLoad of my entity is being issued
    *every* time the entity is retrieved via any of its finder methods. Here are
    my entity-cache settings:


    21000
    0
    ReadOnly
    True


    Anyone have any ideas as to why it's not getting cached? Am I missing something?

  2. Re: ReadOnly beans not being cached

    Try a different value for ...

    jkwon wrote:
    > Hi,
    >
    > I'm having a problem caching ReadOnly entity beans. Namely, they're not getting
    > cached. The reason I know this is because I've checked my P6Spy logs, and the
    > SQL statement that would get generated for an ejbLoad of my entity is being issued
    > *every* time the entity is retrieved via any of its finder methods. Here are
    > my entity-cache settings:
    >
    >
    > 21000
    > 0
    > ReadOnly
    > True
    >

    >
    > Anyone have any ideas as to why it's not getting cached? Am I missing something?


  3. Re: ReadOnly beans not being cached


    Well, read-timeout-seconds value of "0" should be used when you don't ever want
    the ReadOnly bean to call ejbLoad except for the very first time. In other words,
    it should be cached indefinitely, which is what I need it to do.

    Regardless, I tried setting the read-timeout-seconds value to a higher value (10000
    seconds) just to see if maybe the setting of "0" wasn't working properly. However,
    that didn't solve the problem either.

    Moe wrote:
    >Try a different value for ...
    >
    >jkwon wrote:
    >> Hi,
    >>
    >> I'm having a problem caching ReadOnly entity beans. Namely, they're

    >not getting
    >> cached. The reason I know this is because I've checked my P6Spy logs,

    >and the
    >> SQL statement that would get generated for an ejbLoad of my entity

    >is being issued
    >> *every* time the entity is retrieved via any of its finder methods.

    > Here are
    >> my entity-cache settings:
    >>
    >>
    >> 21000
    >> 0
    >> ReadOnly
    >> True
    >>

    >>
    >> Anyone have any ideas as to why it's not getting cached? Am I missing

    >something?



  4. Re: ReadOnly beans not being cached


    Aha. I'm loading up these ReadOnly beans via a findBy method that's not a findByPrimaryKey
    method. Apparently, weblogic only caches readonly beans if they've been loaded
    via the findByPrimaryKey method.

    In my mind, it's disappointing that there isn't a configuration option that will
    let you cache these kinds of results. Actually, I've been pretty disappointed
    with Entities in general, especially in a side-by-side comparison with Hibernate
    (which, among a slew of other things, gives you the option to cache collection
    results).

    "jkwon" wrote:
    >
    >Well, read-timeout-seconds value of "0" should be used when you don't
    >ever want
    >the ReadOnly bean to call ejbLoad except for the very first time. In
    >other words,
    >it should be cached indefinitely, which is what I need it to do.
    >
    >Regardless, I tried setting the read-timeout-seconds value to a higher
    >value (10000
    >seconds) just to see if maybe the setting of "0" wasn't working properly.
    > However,
    >that didn't solve the problem either.
    >
    >Moe wrote:
    >>Try a different value for ...
    >>
    >>jkwon wrote:
    >>> Hi,
    >>>
    >>> I'm having a problem caching ReadOnly entity beans. Namely, they're

    >>not getting
    >>> cached. The reason I know this is because I've checked my P6Spy logs,

    >>and the
    >>> SQL statement that would get generated for an ejbLoad of my entity

    >>is being issued
    >>> *every* time the entity is retrieved via any of its finder methods.

    >> Here are
    >>> my entity-cache settings:
    >>>
    >>>
    >>> 21000
    >>> 0
    >>> ReadOnly
    >>> True
    >>>

    >>>
    >>> Anyone have any ideas as to why it's not getting cached? Am I missing

    >>something?

    >



+ Reply to Thread