0 Replies Latest reply on Jul 12, 2002 9:47 AM by roncordell

    CMP and Multiple Database Instances

    roncordell

      We are working with a single JBoss 2.4.x app server instance against several database instances. Each db instance has the same schema but different data. A user's login determines which database they are working against.

      To accomodate this, we have one CMP entity bean defined for each database table that we are working with and use session bean facades between the entity beans and the client JSP. However, we need to be able to tell the Session bean facade what the database pool name is for the current session so that the appropriate entity bean will be instantiated.

      Our current approach is to extend the EJBObject and EJBHome and EJBSession interfaces with our own interfaces that allows the use of a Factory class to instantiate the facade session bean and set the database name on it before handing it to the client, who can then cast it to the appropriate type. The facade can then use this to construct the JNDI lookup of the appropriate CMP entity bean.

      This all works OK, but when deploying a jar with these extended EJB interfaces causes the JBoss verifier to spit out warnings that the create() methods don't match the particular return type for the session bean facades. This is annoying even though things work OK.

      I was wondering if others out there had faced this issue and how they had solved it?