Notification Support?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
KW
Posts: 135
Joined: Tue 19 Feb 2008 19:12

Notification Support?

Post by KW » Tue 19 Feb 2008 19:15

On the website, it claims that it has database change notification support?

Can you give an example of how to set this up?

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Thu 21 Feb 2008 11:23

Well, the algorithm is actually very simple.
Here are your steps:
- rise a notification on the server side (see MySQL server documentation);
- choose in Visual Studio Forms designer your connection;
- look at Properties Window, click on the Events button;
- now you will see Error, InfoMessage and StateChange events;
- simply subscribe to the InfoMessage event;

KW
Posts: 135
Joined: Tue 19 Feb 2008 19:12

Documentation

Post by KW » Thu 21 Feb 2008 17:51

Thats where I got confused, I've read that Mysql doesn't have notification messages. Apparenlty this is incorrect?

I see the event under the connection object (InfoMessage event), but could you please link me the mysql documentation that says how to setup server side events?

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Fri 22 Feb 2008 09:23

I have been searching all MySQL server documentation and
didn't find any scent of raising notifications on the server side.
Unfortunately, the server doesn't support this feature.

KW
Posts: 135
Joined: Tue 19 Feb 2008 19:12

Post by KW » Fri 22 Feb 2008 17:45

Alright, so bascially it supports change notification but it doesn't really matter since mysql doesn't support it.

Hope this helps others who think mysql supports change notification.

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Mon 25 Feb 2008 16:26

What notification would you like to receive (please explain the logic)?
What kind of projects do you develop?
Probably we could find an alternative way to solve this problem.

KW
Posts: 135
Joined: Tue 19 Feb 2008 19:12

Post by KW » Mon 25 Feb 2008 17:47

Alexey.mdr wrote:What notification would you like to receive (please explain the logic)?
What kind of projects do you develop?
Probably we could find an alternative way to solve this problem.
We use typed datasets with windows forms. There really isn't an easy way to refresh the data in the dataset when updates are made to the database. Easiest way to update the data is simply poll the database for the changes.

I am guessing that this doesn't scale very well and is the reason while polling is the acceptable method?

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Tue 26 Feb 2008 12:49

Probably you can use CoreLab.MySql.Web.MySqlCacheDependency class.
It represents a process that periodically polls the server and fires an event
if it detects changes in monitored tables.
Please refer to the documentation for the example.

KW
Posts: 135
Joined: Tue 19 Feb 2008 19:12

Post by KW » Tue 26 Feb 2008 17:47

Alexey.mdr wrote:Probably you can use CoreLab.MySql.Web.MySqlCacheDependency class.
It represents a process that periodically polls the server and fires an event
if it detects changes in monitored tables.
Please refer to the documentation for the example.
I'm sorry, I've looked around for the documentation and haven't been able to find anything. I've also looked for the example, but haven't seem to come have found it.

Could you give me more information on where this example is?

I've been looking at the docs here:

http://www.crlab.com/mysqlnet/docs/

I see that this component is intended for web forms, does it work for winforms as well?

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Wed 27 Feb 2008 11:41

You can find help on MySqlDependency class in your local MyDirect .NET help.
It's faster to find it using Index search.

The example of MySqlDependency class usage you can find in
WinForms sample project here:
%Program Files%CoreLab\MyDirect.NET2\Samples\WinForms\

P.S. I have misspelled the class name in the previous post.
Last edited by Alexey.mdr on Tue 10 Jun 2008 08:24, edited 1 time in total.

KW
Posts: 135
Joined: Tue 19 Feb 2008 19:12

Post by KW » Wed 27 Feb 2008 18:54

Alexey.mdr wrote:
P.S. I have misspelled the class name in the previous post.
That was the problem.

Let me work with this component today and I'll post feed back.

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Thu 28 Feb 2008 12:11

Waiting for your reply.
Hope the problem will be solved.

KW
Posts: 135
Joined: Tue 19 Feb 2008 19:12

Looks good

Post by KW » Mon 03 Mar 2008 21:48

Alexey.mdr wrote:Waiting for your reply.
Hope the problem will be solved.
This seems to work pretty well and is very easy to setup. So yes, I'd say this look like it'll work for polling the database. Thanks for putting my attention to this component.

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Tue 04 Mar 2008 11:49

We are glad that everything is ok now.
Feel free to contact us if you encounter any problem with MyDirect .NET

Post Reply