0 Replies Latest reply on Jul 10, 2002 3:05 PM by roncordell

    Session Facades for Entity Beans Multiple DB 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.

      Our current approach is to create 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. 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? Is it possible to access the database name from the JSP session from within the EJBSession context?