2 Replies Latest reply on Sep 25, 2003 9:33 AM by juha

    CMP2.0 Docs and read-ahead

    armint

      In the CMP2.0 docs Appendix A discusses putting read-ahead in jbosscmp-jdbc.xml. However, immediatley before this, there is an example showing read-ahead inside ejb-jar.xml. I assume this is a mistake and have set the read-ahead tags (i.e.strategy, limit, cache-size) in jbosscmp-jdbc.xml. After deploying read-ahead entity, I have a remote client call a finder and iterate thru the returned collection. The log file shows N+1 SELECT's. No read-ahead. Switching off the read-ahead yields the same results except no JDBCStoreManager.PreloadKeys are being created.

        • 1. Re: CMP2.0 Docs and read-ahead
          aparaapara

          I just worked through a similar problem. It seems that you might need to have a TX wrapped around your read operation. The keys from the finder are returned in one TX, and access is occuring in another TX. This could explain the multiple SELECTS.

          Try to have your client create a TX, or better yet, wrap access in to a SSB with it's own TX attribute set.

          -AP_

          • 2. Re: CMP2.0 Docs and read-ahead

            Yes you're going to need a tx, check the transaction related discussion at the end of the CMP documentation.

            -- Juha