Page 1 of 1

Notification Support?

Posted: Tue 19 Feb 2008 19:15
by KW
On the website, it claims that it has database change notification support?

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

Posted: Thu 21 Feb 2008 11:23
by Alexey.mdr
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;

Documentation

Posted: Thu 21 Feb 2008 17:51
by KW
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?

Posted: Fri 22 Feb 2008 09:23
by Alexey.mdr
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.

Posted: Fri 22 Feb 2008 17:45
by KW
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.

Posted: Mon 25 Feb 2008 16:26
by Alexey.mdr
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.

Posted: Mon 25 Feb 2008 17:47
by KW
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?

Posted: Tue 26 Feb 2008 12:49
by Alexey.mdr
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.

Posted: Tue 26 Feb 2008 17:47
by KW
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?

Posted: Wed 27 Feb 2008 11:41
by Alexey.mdr
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.

Posted: Wed 27 Feb 2008 18:54
by KW
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.

Posted: Thu 28 Feb 2008 12:11
by Alexey.mdr
Waiting for your reply.
Hope the problem will be solved.

Looks good

Posted: Mon 03 Mar 2008 21:48
by KW
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.

Posted: Tue 04 Mar 2008 11:49
by Alexey.mdr
We are glad that everything is ok now.
Feel free to contact us if you encounter any problem with MyDirect .NET