Page 1 of 1

Persist Shared Record to secondary datasource

Posted: Wed Mar 22, 2017 2:56 pm
by eric.graham
Hello -
I have a need for a Shared Record to persist to a separate data source (defined in the openejb.xml connections), other than the LSPS_DS data source that is being used to connect the application. – I see “Schema:” field, but this does not seem to fulfill my need. – The data is being persisted to the main LSPS_DS data source, but I am needing the Shared Record to persist to a different/secondary data source that has been defined in the openejb.

How can this be achieved?

(all tables and columns are the same between the two data sources, I am just needed to persist to the secondary data source vs the main LSPS_DS data source. - I am using 3.1 PDS, Build: 3.1.1024)

Thank you in advance!

Re: Persist Shared Record to secondary datasource

Posted: Mon Mar 27, 2017 4:33 pm
by Roman Kubascik
Hi Eric,

Yes, it's possible, you can set database/datasource for shared records which are defined in the datatypes file.

1. Open the datatypes definition for editing.
2. In the Outline view, select the root Data Types item.
3. In the Properties windows, change the Database property.

More details you can find in the documentation.

Regards,
Roman

Re: Persist Shared Record to secondary datasource

Posted: Thu Mar 30, 2017 5:05 pm
by Byron Glueck
If there is an existing modeled relationship between shared record A to a shared record B, then the relationship navigation will be broken by separating the records into different data type configurations (sources).

In this case, one should consider storing instead the identifier of the foreign/related record(s) and programmatically performing a find() operation to retrieve the related record(s), as necessary.

Re: Persist Shared Record to secondary datasource

Posted: Mon Apr 03, 2017 8:56 pm
by eric.graham
Roman / Byron -
Thank you both for your advise on this issue. We were ableto achieve our desired needs, based on both you advise on spitting the datatypes to point to the desired Schema. ;)

Thanks again for your help!