OracleCacheDependency

OracleCacheDependency

Establishes a relationship between an item stored in an application's Cache object and either a row in a specific Oracle database table or the results of a Oracle query. This class can not be inherited.


Constructor

# new OracleCacheDependency(connectionString, cmdText, cmdType, cmdParams)

Initializes a new instance of the OracleCacheDependency class, using the supplied connection string and query string. This constructor is used to create OracleCacheDependency objects that use the query-notification feature of Oracle products. Query must include the following: Fully qualified table names, including the name of the table owner. For example, to refer to a table called "customers" that is owned by the database owner, the statement must refer to "dbo.customers".

Parameters:
Name Type Description
connectionString String

connection string to be used by dependency.

cmdText String

cmdText to be used by dependency

cmdType OracleCommandType

The type of the command.

cmdParams Map

Parameters to be passed to the command.

Example
//Initialize the Cache Cluster 
let cache = await ncache.CacheManager.getCache("demoCache");

/// Notification based DBDependency
// JDBC connectionString     
let connectionString = "jdbc:oracle:thin:SCOTT/host@//20.200.20.10/orcl.host.org.pk";
let commandText = "SELECT ROWID, ProductID, ProductName, UnitPrice FROM Products WHERE ProductID = 1";

// create CacheItem to with your desired object
let cacheItem = new ncache.CacheItem("OracleDependentValue");

let oracleDependency = new ncache.OracleCacheDependency(connectionString, commandText);
cacheItem.setDependency(oracleDependency);

// Inserting item into cache 
await cache.add("key-1", cacheItem);

Methods

# getCommandParams() → {Map}

Get type of the parameters passed to the Oracle command.

Returns:

Returns Map<String, OracleCmdParams>.

Type
Map

# getCommandText() → {String}

Gets CommandText to be used by dependency.

Returns:

Returns CommandText.

Type
String

# getCommandType() → {CommandType}

Get type of the Oracle command passed to the OracleDependency.

Returns:

Returns type of the Oracle command.

Type
CommandType

# getConnectionString() → {String}

Get connection String that is required by the cache in order to connect with database.

Returns:

Returns connection String.

Type
String