Re: Configuring multiple DataNodes

2021-04-23 Thread John Huss
No, it supports System Properties passed to the Java process with -Dproperty.name=value but not reading from environment variables directly. On Fri, Apr 23, 2021 at 12:42 PM Tony Giaccone wrote: > Andrus, > > with these properties, you set an environment variable like this: > > $ export

Re: Configuring multiple DataNodes

2021-04-23 Thread Tony Giaccone
Andrus, with these properties, you set an environment variable like this: $ export cayenne.jdbc.driver.eps.oracleDb=oracle.jdbc.OracleDriver and that sets the driver on that sdt of domain and node name? Tony On Fri, Apr 23, 2021 at 11:52 AM Andrus Adamchik wrote: > also per-node connection

Re: Configuring multiple DataNodes

2021-04-23 Thread Andrus Adamchik
also per-node connection params can be passed as properties: https://cayenne.apache.org/docs/4.1/cayenne-guide/#appendix-a-configuration-properties > On Apr 23, 2021, at 10:58 AM, John Huss wrote: > >

Re: Configuring multiple DataNodes

2021-04-23 Thread John Huss
When you create your ServerRuntime you need to supply a custom DI module to pass the DB connection parameters, something like this: *import* org.apache.cayenne.configuration.Constants; *import* org.apache.cayenne.di.Binder; *import* org.apache.cayenne.di.MapBuilder; *import*

Configuring multiple DataNodes

2021-04-23 Thread Tony Giaccone
I have a datadomain with two datamaps, and two datasource each talking to a different database. Right now, I have had the datasource configured in the config file, but I need to remove that and set it programmatically, from an environment variable. Simple enough to do with a defauldata source,

Re: Cayenne-Generated PK (NULL not allowed for column "ID")

2021-04-23 Thread Andrus Adamchik
Sorry, this fell through the cracks. Yeah, there's API to reset PK generator (unfortunately the only piece of the stack that is not managed via DI): ServerRuntime runtime = ...; runtime.getDataDomain().getDataNode("mynode").getAdapter().setPkGenerator(new JdbcPkGenerator()); Andrus > On