Moqui connect to Master and Replica database

105 Views Asked by At

I am new in Moqui and want to connect to two mysql databases, one to write on(master) and one to read from (replica), how to do this?

1

There are 1 best solutions below

1
On

I found a solution for this, i used

Connection con = ec.entity.getConnection("replica-group-name")
ps = con.prepareStatement("SElECT statement")
rs = ps.executeQuery()

this code is doing 50% of what i want, i am now trying to make the entity-find to use the replica instead of transactional datasource