We're currently in the process of migrating our Pega implementation from the cloud to an on premise server. We currently have Tomcat setup to point to Oracle with the entries like the one below in our context.xml. This works fine but we'd prefer to have Tomcat pull the url info from the TNSNAMES.ORA file that is managed by our database team so we don't have to worry about manually updating the Tomcat config if addresses are added/removed to the address list. Is it possible to reference a server in Tomcat just by the address name in the TNS names file?
I see that your JDBC URL uses a TNS keyword-value pair connection string to connect to your database. This is primarily used / recommended from connecting from thick client applications like (Java SWINGs/ Applet/ Java).
However, Oracle recommends the following URL connection string for Datasources while connecting from Application server. This is for the same reason / problem you are trying to address.
As you can see from the format above, the connection String in the Tomcat's DataSource config simply refers to the Oracle database SERVICE_NAME. The connection resolution happens at based on the ADDRESSES defined on tnsnames.ora and there is no hard coupling of the TNS ADDRESS in the Datasource connection string.
Discuss internally to see if you can use/test the above recommended connection string style to solve your problem.
Posted: 5 years ago
Posted: 1 Nov 2017 14:57 EDT
Andy Casey (AndyC853)
Quad Graphics Inc
Quad Graphics Inc
Thanks for the response. The problem is our production server will be on one of 3 clusters. I'm assuming that format wouldn't work since we'd have 3 different host names. The entry for our production server in the tns names file looks something like this: