I am trying to use the Oracle CQN/OracleDependency feature within DevArt/Oracle.
I create the following query:
Code: Select all
select id, last_update_datetime from my_table t where t.id = 12345
The first problem I have is when I try to set the
Code: Select all
Notification.OracleQueryBasedNotificationMode == OracleQueryBasedNotificationMode.Guaranteed;
I get the following exception:
Code: Select all
ERROR: Devart.Data.Oracle.OracleException (0x80004005): ORA-29977: Unsupported column type for query registration in guaranteed mode
at Devart.Data.Oracle.be.d(Int32 A_0)
at Devart.Data.Oracle.de.a(Int32 A_0, s A_1)
at Devart.Data.Oracle.OracleCommand.InternalExecute(CommandBehavior behavior, IDisposable disposable, Int32 startRecord, Int32 maxRecords, Boolean nonQuery)
at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
at Devart.Data.Oracle.OracleCommand.ExecuteReader()
at ...**myfunction**...
Code: Select all
OracleQueryBasedNotificationMode.BestEffort
Here's the code I use to setup the callback:
Code: Select all
connection.Open();
OracleCommand cmd = new OracleCommand(sqlSelect, connection);
dep = new OracleDependency(cmd);
cmd.Notification.IsNotifiedOnce = true; // only notify once for testing purposes, false will continuously listen for updates
cmd.Notification.Timeout = 0; // never timeout
cmd.Notification.IsPersistent = false; // persist the message in-memory queue, faster on the db than if set to true
cmd.Notification.QueryBasedNotificationMode = QMode;
cmd.Notification.RowLevelDetails = true;
dep.OnChange += new OnChangeEventHandler(callbackAction);
var dr = cmd.ExecuteReader();
I'm using devart 9.2.x drivers with oracle 12.1 server and 12.1 OCI 64bit drivers.
Has anyone successfully been able to use OracleDependency notifications and let me know if I'm missing anything?