Hi, i have few more questions about alerts
1. i really dont understand this https://www.devart.com/dotconnect/postg ... on_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.
Alert/notify
Re: Alert/notify
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();
}
}
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Alert/notify
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:1. i really dont understand this https://www.devart.com/dotconnect/postg ... on_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.
PgSqlAlerter works in a separate thread.spliter wrote:Is it possible, that alerter is on different thread?
The code looks valid, but without knowing the purpose of the code, it’s hard to comment it.spliter wrote:I dont know is that right way, but it working. I hope on your comments about it.
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Alert/notify
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.
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Alert/notify
New version of dotConnect for PostgreSQL 7.9 is released!
It can be downloaded from http://www.devart.com/dotconnect/postgr ... nload.html (trial version) or from Customer Portal (for users with valid subscription only).
For more information, please refer to viewtopic.php?t=35438
It can be downloaded from http://www.devart.com/dotconnect/postgr ... nload.html (trial version) or from Customer Portal (for users with valid subscription only).
For more information, please refer to viewtopic.php?t=35438