I have this 2 appservices: asBroker1 and asBroker2.
1 is connected to db1, and 2 is connected to db2. 1 code, two separate use cases inside company. So Life is nice....
Both databases has employee table. One source function worked fine when each app needed it's corresponding employees.
Now I need in one client application to get data from d1 and db2. I need to query db1.employee inside app2 and make some adjustments on db2.employee.
I'm facing two options as far I can see.
option 1. create another FetchEmployee.p function (with another name, of course) so this would be the plan:
1.a connect to the second db with an alias, and run the newly created function. Fill dataset1.b disconnect from alias db. I just got the reference table in a temp-table now...
Cons: would be a nigthmare to maintain, as would be necessary to connect to another database profile on the project just to compile modified FetchEmployee(2) with the alias name.
option 2: Connect from appservice 2 to appservice 1:
2a. connect from app2 to app1 and send it to FetchEmployee.p, as the broker on service1 is already connected to reference db. Fill the dataset and pass back to asbroker2.2b. close the connection to asbroker1 and do our stuff within asbroker2.
Cons. It flashed to me as I can't find a good solution to this use case... but wonder... wouldn't it be akward? Isn't another solution?
Just to add... I figured out another option.... first load employees (connect to asbroker1, fire away the FetchEmployee.p, disconnect, delete object hServer), then go on with the natural processing of client (which expects everything came from asbroker2.. sometime the clever solution is the unique solution...