Alert/notify

Alert/notify

Postby spliter » Tue 25 Apr 2017 17:16

Hi, i have few more questions about alerts
1. i really dont understand this https://www.devart.com/dotconnect/postgresql/docs/Devart.Data.PostgreSql~Devart.Data.PostgreSql.PgSqlConnection~Notification_EV.html between pgalert. Starting i thought this is another way to get notify messages, and there is possibility to get ProcessID, because i cant find in PgAlerter, but it didnt worked for me.

2. Does alerter works in other threads? My program posts data and send notify. My PgAlerter is on new connection but in same program. So basically, program posts data and also recive, that data changed.
a) in Delphi i can get connectionID and verify, that executed by itself, so i can skip double refresh
b) one data refresh didnt finished, when alerter executed new one, so program just crashed. Is it possible, that alerter is on different thread? I cant find any information in your help about it.
spliter
 
Posts: 4
Joined: Sun 16 Apr 2017 10:10

Re: Alert/notify

Postby spliter » Tue 25 Apr 2017 17:22

I dont know is that right way, but it working. I hope on your comments about it.

Code: Select all
private void ZPgEventAlerter_Alert(object sender, PgSqlAlerterAlertEventArgs e)
        {
            if (Program.MainFormInstance.InvokeRequired)
            {
                //if MainDM.DBConnectionPID <> ProcessID  then
                if (e.AlertName == "shift_update")
                    Program.MainFormInstance.Invoke(new Action(() => RefreshActiveShift()));
                else if (e.AlertName == "shift_pile_update")
                    Program.MainFormInstance.Invoke(new Action(() => RefreshActivePile()));
            }
            else
            {
                if (e.AlertName == "shift_update")
                    RefreshActiveShift();
                else if (e.AlertName == "shift_pile_update")
                    RefreshActivePile();
            }

        }
spliter
 
Posts: 4
Joined: Sun 16 Apr 2017 10:10

Re: Alert/notify

Postby Pinturiccio » Fri 28 Apr 2017 12:52

spliter wrote:1. i really dont understand this https://www.devart.com/dotconnect/postgresql/docs/Devart.Data.PostgreSql~Devart.Data.PostgreSql.PgSqlConnection~Notification_EV.html between pgalert. Starting i thought this is another way to get notify messages, and there is possibility to get ProcessID, because i cant find in PgAlerter, but it didnt worked for me.


At the moment we don’t pass ProcessId to PgSqlAlerterAlertEventArgs. We have added the ProcessId property to PgSqlAlerterAlertEventArgs. We will post here when the corresponding build of dotConnect for PostgreSQL is available for download.

spliter wrote:Is it possible, that alerter is on different thread?

PgSqlAlerter works in a separate thread.

spliter wrote:I dont know is that right way, but it working. I hope on your comments about it.

The code looks valid, but without knowing the purpose of the code, it’s hard to comment it.
Pinturiccio
Devart Team
 
Posts: 2020
Joined: Wed 02 Nov 2011 09:44

Re: Alert/notify

Postby Pinturiccio » Thu 04 May 2017 12:02

We have added the ProcessId property to the PgSqlAlerterAlertEventArgs class. We will post here when the corresponding build of dotConnect for PostgreSQL is available for download.
Pinturiccio
Devart Team
 
Posts: 2020
Joined: Wed 02 Nov 2011 09:44

Re: Alert/notify

Postby Pinturiccio » Fri 26 May 2017 09:55

New version of dotConnect for PostgreSQL 7.9 is released!
It can be downloaded from http://www.devart.com/dotconnect/postgresql/download.html (trial version) or from Customer Portal (for users with valid subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?t=35438
Pinturiccio
Devart Team
 
Posts: 2020
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for PostgreSQL