2 Replies Latest reply on Apr 18, 2004 10:11 PM by Alwyn Schoeman

    CMR with optimal caching

    Alwyn Schoeman Newbie


      I'm trying to implement a 1 to * CMR between 2 beans making optimal use of caching.

      The system is used to map specific SMS keywords to specific session beans and the parameters to certain variables.

      Bean A fields:
      Keyword (keyword coming from phone),
      ServiceCode (application identifier),
      Handler (Jndi of session-bean that will handle keyword)

      According to my understanding of the caching, the best way is to not use a finder but use getByPrimaryKey. So the PK for Bean A would be a composite of Keyword and ServiceCode so that the database do not need
      to be queried for a PK to find the bean in the cache with.

      Bean B maps the keyword parameters.
      Bean B fields:
      offset (offset from left to right from the keyword),
      parameter (variable to map it to)

      Now there is obviously something missing, the foreign key to Bean A and perhaps even a PK for bean B.

      What needs to be added to Bean B to get this working? It is important that the solution would optimize cache and database access too.

      Best regards,