Using two containers on one servletEngine

Discussions

EJB programming & troubleshooting: Using two containers on one servletEngine

  1. Using two containers on one servletEngine (4 messages)

    Hi All,
       I am using two Containers on one ServletEngine in WAS 3.5.3.Now my problem is that when I call the ServletEngine it should read some Data from Entity Bean 1 which is in Container 1 and when I call Entity Bean 2 then it should go and read it from Container 2.How can get the Reference of these Containers in my ServletEngine.If anybody has used two Containers with one ServletEngine in Webspehere..
    Then it 'll be very helpful for me.
    Thanks in Advance
    Deep
  2. Why are you using two containers for one ServletEngine? That seems like a little overkill to me. Do you have two instances of Websphere running?
  3. No I don't have two Instances running I don't want to use two instances....I want to use to Contaniners in One ServletEngine..and I think websphere aloows me to do that...
    Do you have any idea about this.
    These two Containers are connected to two Different DB....I mean one is connected to Oracle and One is connected to Sybase..everything works but I don't know how to call the instances of the Container from the servletEngine...I have written a Servlet also for this...
    Did you get my point
  4. Sorry I misunderstood. You need to setup two Datasource objects that you would use to connect to either database. I probably wouldn't refer to them as containers though. What type of entity beans are you using? If you are using CMP entity beans, then you will not be able to switch the datasource on the fly. If you use one datasource per bean, then you would be alright. You could switch on the fly with BMP persistence or any other scenario that is not using CMP.

    Good luck,

    Kent
  5. I am using two datasource..thats fine with me....I can do that for the beans..The beans are also same only the database is changed....
    Lets say I have GetDataBean which I have deployed on Container_1 and also on Container_2 ....I am using diff datasources for this.But the questions arises over here is when How can I call GetDataBean on Contianer_1 and how can I call GetDataBean on Container_2.
    Bcoz in my server both the Containers are running .....
    So from Servlet point of view how do I know that which Container to call and how.....
    How the ServletEngine will know which Container to call..???
    Deepak