Note that there are some explanatory texts on larger screens.

plurals
  1. POChange Notification with Oracle Dependency in C#
    primarykey
    data
    text
    <p>I'm trying to get oracle database change notification in c#. I found <a href="http://docs.oracle.com/cd/B19306_01/win.102/b14307/featChange.htm#BABDGFBH" rel="nofollow">this tutorial</a> about how to get these notifications. I've also created simple win form application for catching notifications</p> <pre><code>public partial class Form1 : Form { public Form1() { InitializeComponent(); SetUpNotification(); } private void SetUpNotification() { var login = "DATA SOURCE=XE;PERSIST SECURITY INFO=True;USER ID=USR;PASSWORD=PWD"; OracleConnection conn = null; OracleDependency dep = null; try { conn = new OracleConnection(login); var cmd = new OracleCommand("select * from customer_details", conn); conn.Open(); cmd.AddRowid = true; dep = new OracleDependency(cmd); cmd.Notification.IsNotifiedOnce = false; dep.OnChange += new OnChangeEventHandler(dep_OnChange); } catch(Exception e) { MessageBox.Show(e.Message, e.Source, MessageBoxButtons.OK, MessageBoxIcon.Error); } } void dep_OnChange(object sender, OracleNotificationEventArgs eventArgs) { MessageBox.Show(eventArgs.Details.ToString(), "Database changed"); } } </code></pre> <p>Login string and OracleCommand cmd are 100% fine. I tried also to change database programmatically, it changed data in database, but didn't fired OnChange event. </p> <p>I also granted notifications tu USR user</p> <pre><code>grant change notification to USR </code></pre> <p>and job_queue_processes are greater than zero.</p> <p>Can be a problem in a fact, that I am using <strong>Express edition</strong> of oracle database?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload