This discussion is archived
1 Reply Latest reply: Jun 6, 2012 8:48 AM by RaviJegga RSS

Datasource Configuration

710020 Newbie
Currently Being Moderated
Hi,


How two deploy 2 datasources with same name across 2 different domains without modifying either domain.

Domain A

Datasource Name : DS_01

Domain B

Datasource Name: DS_01

Regards.
  • 1. Re: Datasource Configuration
    RaviJegga Expert
    Currently Being Moderated
    Hi
    1. Once you have Totally 2 Different Domains, remember that they are Totally 2 Different Worlds. Means, yes you can have all the resources like DataSources, EJBs, Apps etc etc with the SAME names deployed to these 2 domains. Remember that, if these 2 domains are on the same machine, one basic and minimum requirement is all the servers in both these domains should have UNIQUE ports. Lets say if you have 2 Domains with just 1 AdminServer each, then the ports may be like this:
    Domain1 -> AdminServer:7001
    Domain2 -> AdminServer: 5001 (Anything other then 7001).
    But if these 2 domains are on different machines, then they can have same port numbers also.

    2. Coming to your question, you have 2 ways to create/deploy DataSources. One is open Weblogic Admin Console, using like http://adminhost:adminport/console and from here create a DataSource giving all the details. Repeat the same for other domain also using that console.

    3. If you want to do in Single shot, write a Simple WLST Script. In this script very first thing is you need to give admin server host, port and credentials. Just run this 2 times, giving domains details.

    One basic thing you need to remember. When you access these DataSources, all you need is get InitialContext giving admin server host, port. Then do JNDI Lookup for that DataSource name. So the admin server host, port makes the difference.

    I hope this is what you were looking for. If not, please elaborate your question/requirements.

    For WLST, you can google around and find lots of fully working examples. Heres one of them. Its an old post, but the concepts should be the same.
    http://unni-at-work.blogspot.com/2009/02/creating-jdbc-data-source-using-wlst_20.html

    Thanks
    Ravi Jegga

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points