when I try to use the change notification feature I will receive following error message:
ORA-29970: Angegebene Registrierungs-ID ist nicht vorhanden
Please see the attached file, maybe I am using this feature wrong. Is there any documentation for this feature or sample code. I didn't find any with my installation. Can you please help me? I am are using CoreLab.Oracle.dll version 4.70.37.0
Thanks,
Rainer
Code: Select all
OracleDependency.Port = oracleChangeNotifierDef.Port;
using(OracleCommand oracleCommand = Utils.CreateOracleCommand(this, oracleChangeNotifierDef.Command))
using(OracleDependency oracleDependency = new OracleDependency(oracleCommand))
{
OracleNotificationRequest notification = oracleCommand.Notification;
notification.IsNotifiedOnce = oracleChangeNotifierDef.TimeoutCount == 1;
notification.IsPersistent = oracleChangeNotifierDef.IsPersistent;
notification.RowLevelDetails = oracleChangeNotifierDef.RowLevelDetails;
notification.Timeout = oracleChangeNotifierDef.GetTimeoutSeconds();
//Activate the notifier and wait until is is elapsed
oracleDependency.OnChange += OracleDependency_OnChange;
oracleCommand.ExecuteScalar();
WaitElapsed();
Code: Select all
private void OracleDependency_OnChange(object sender, OracleNotificationEventArgs args)
{
try
{
Dictionary parameters = new Dictionary();
parameters.Add("Type", args.Type);
DataTable dataTable = args.Details;
if(dataTable != null)
{
DataSet dataSet = new DataSet();
dataSet.Tables.Add(dataTable);
using(StringWriter stringWriter = new StringWriter())
{
dataSet.WriteXml(stringWriter, XmlWriteMode.WriteSchema);
parameters.Add("Details", stringWriter.ToString());
}
}
Activate(parameters);
}
catch(Exception exception)
{
Log.Error(string.Format("Error activating trigger: {0}", def.Caption), exception);
if(!def.ContinueOnException) SetElapsed();
}
}