Posted: 3 May 2018 2:38 EDT Last activity: 7 Jun 2018 2:21 EDT
Global Resource Setting
I have two questions for you about Global Resource Setting:
- I have to get Database url from properties file, so I've loaded a Datapage with a Datatransform, and tried to use GRS to set Database url, but I failed to do it. I succeeded to use GRS in Connect-File and Connect-Soap, but not in Database record.
So I wonder if I can use GRS in Database record, and for instance write something like =D_DataPageName.PropertyName in url field, instead of hardcode it. Is it possible to do it, and if it is, is there an example on the PDN? I haven't find one...
If not, how to set Database url from property file, or to update it when server changes, or when migrating application? Do we have to create Database record on each environment prior to migration, and to manually update url value when needed?
- I will have many (too much:-) properties to get from files and that can often change, so I'd like to use GRS to get them all from a single shared and parameterized Datapage in a commun class, but I fear it will cause performances problems.
So I'd wonder if it is a best practice to use a single shared and parameterized Datapage instead of one per class...
Thanks in advance if you have some informations!
And have a nice day!
***Updated by moderator: Lochan to update Categories***
Thank you very much Chandrasekhar for your answer:-), and what about Database url: do you think url field in Database record supports GRS and did you try it? It would be very useful but I still not succeed...
So to avoid hardcode the connect string, instead of JDBC URL I tried to use JNDI name to connect to an external DataBase. That way I succeed to access an external DataBase only if the DataSource is declared on the server where Pega is installed, not if the DataSource is declared on another server: I don't know where to indicate the other server name (both are JBoss servers).
Is it possible to access a DataBase when the DataSource is declared on another server? Do I have to concatenate the server name to the DataSource name in the JNDI name field? I tried many things but it doesn't work... I've seen there is a JNDI server rule but it seems it isn't usefull. Or does the other server name have to be indicated in the prconfig file?
It must be possible but I don't know how... Do you have an idea?
Posted: 3 years ago
Posted: 23 May 2018 22:30 EDT
Vikash Ranjan Karn (Vikash Karn)
Senior Technical Solutions Engineer
Yes the JDBC jar is available, and I succeed to access the same external DataBase with JDBC url, and also with JNDI name when the DataSource is declared on the same server (where Pega is installed), but not when it is declared on another server.
I obtain a javax.naming.NameNotFoundException: The DataSource is invalid: Unable to obtain DataSource object. A connection could not be obtained.
The JNDI name is like this: java:jboss/datasources/dbname. The server name is not indicated here, I don't know where to indicate it, so I think it may be the cause of the problem, but it may be something else...
Hello Vikash:-), somebody told me that the DataSource used by a DataBase have to be on the same server, so a I think that what I wanted to do isn't possible, because the servers can't know each other... Thank you anyway and have a nice day!