Package org.compiere.util
Class DBReadReplica
java.lang.Object
org.compiere.util.DBReadReplica
Support class for read only replica DB
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static Connection
Get read only connection from replica DBstatic PreparedStatement
prepareNormalReadReplicaStatement
(String sql, int resultSetType, int resultSetConcurrency, String trxName) Prepare Normal Read Replica Statement
-
Constructor Details
-
DBReadReplica
public DBReadReplica()
-
-
Method Details
-
prepareNormalReadReplicaStatement
public static PreparedStatement prepareNormalReadReplicaStatement(String sql, int resultSetType, int resultSetConcurrency, String trxName) Prepare Normal Read Replica Statement- Parameters:
sql
- sql statementresultSetType
- - ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency
- - ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLEtrxName
- transaction- Returns:
- Prepared Statement (from replica if possible, otherwise null)
-
closeReadReplicaStatement
-
getConnectionRO
Get read only connection from replica DB- Returns:
- connection
-