I want to understand how the Oracle db active passive connection works with Node js. Currently my project is using loopback Oracle connector node module. What configuration I have to do in db or app or env level to complete the setup.
1 Answer
Asuming you connect through a connection pool you don’t need to do anything since the connection pool should take care of failed connections, as long as one succeeds.
This ofcourse assumes a correct sqlnet configuration in the connection pool, that by itself should be prefixed by a vip.
4 Comments
Christopher Jones
Some of the node-oracledb doc on high available may help. Most (all?) of this can be set and used with Loopback.
jolly
I used connectString and passed DESCRIPTION_LIST, it is throwing "Error: ORA-12545: Connect failed because target host or object does not exist". const connectString =
(DESCRIPTION_LIST=(LOAD_BALANCE=OFF)(FAILOVER=ON)(DESCRIPTION=(CONNECT_TIMEOUT=5)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=${process.env.DB_HOST_1})(PORT=${process.env.DB_PORT_1})))(CONNECT_DATA=(SERVICE_NAME=${process.env.DB_NAME_1})))(DESCRIPTION=(CONNECT_TIMEOUT=5)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=${process.env.DB_HOST_2})(PORT=${process.env.DB_PORT_2})))(CONNECT_DATA=(SERVICE_NAME=${process.env.DB_NAME_2}))));