Skip to main content

Synchronous notification landed in cvs.

Hi all,

I finally could get synchronous notification done. It is in cvs now.

What is synchronous notification?
Up to now, in order to get notifications from postgresql, Npgsql clients would need to call empty commands. If application didn't do that, only on next NpgsqlCommand.Execute* call notification would be delivered.
Now with synchronous notification, client applications are notified as soon as message arrives, hence the name synchronous notification.

On current code, it is disabled by default. To enable it, you have to put syncnotification=true in your connection string.

How it works?

When you enable synchronous notification, Npgsql will create another thread to check is data arrived in socket. To do that, it uses Socket.Poll method. When Npgsql is idle, this thread is running. It is stopped as soon as any NpgsqlCommand.Execute* method is called and resumed when this call returns.

Side effects:

Because of synchronization of threads, there is performance drop when using synchronous notification. So, if you want max performance, don't use it. Synchronous notification is more valuable on desktop applications where they have more idle cycles and need more "real time" notifications.

Please, give it a try and let me know if you find any problems.

Comments

Anonymous said…
I'm glad you're recovering pretty fast. Slightly OT: The link to the NPGSQL homepage to the right doesn't work (it's mispelled: http://http//pgfoundry.org/projects/npgsql/).
Hi Kalme!

Thanks!

Also, I fixed link. Good catch!
Anonymous said…
HEEEEEELLLLLLLLOOOOOOOOO BLOGGERSSSSSS..

I would like to tell everyone I know about a new web site for web hosting plans... If you are looking on ways to mkae money starting a business and need a site to host it on . Visit http://webhost-er.com/ Today
Anonymous said…
wow gold | world of warcraft gold | wow power leveling | Cheap WoW Gold | Cheapest WoW Gold | Buy Cheap WoW Gold | cheapest wow gold | Buy WoW Gold | sell wow gold | WoW Accounts | wow accounts for sale | Buy WoW Power Leveling | Wow Honor Leveling | WoW profession leveling | WoW Reputation Leveling | WoW CD Key | WOW EU Gold | Cheap WoW Gold | wow gold for sale | Cheap WoW Power Leveling | WoW EU Accounts | world of warcraft accounts for sale | WoW EU CD Key | Lineage 2 Adena | Buy L2 Adena | Lineage 2 Adena for sale | Lineage 2 Accounts | Lineage 2 Power Leveling | Lineage 2 CD Key | Warhammer gold | Buy Warhammer Gold | Warhammer US Gold | Warhammer Power leveling | Warhammer CD Key | Warhammer Accounts | Warhammer EU Gold | Buy Cheap Warhammer Gold | WAR EU Gold | Buy Warhammer Power Leveling | Warhammer Online Accounts | Warhammer EU CD key | Aion gold | fast delivery Aion Gold | Aion Accounts | Aion Power Leveling | Aion CD Key | runes of magic gold | cheap runes of magic gold | runes of magic accounts | runes of magic power leveling | runes of magic cd key | runes of magic online gold | buy runes of magic eu gold | wow cheats | rom power leveling | runes of magic eu accounts for sale | cheap runes of magic cd key | FFXI Gil | Cheap FFXI Gil | Final Fantasy XI Gil | FFXI Power Leveling | FFXI CD Key | LoTRO Gold | Cheap Lotro Gold | LoTRO US Gold | LoTRO Accounts | Lotro accounts for sale | LoTRO Power Leveling | LoTRO CD Key | LoTRO EU Gold | Lord of the Rings Gold | LoTRO EU Accounts | Lotro Leveling | Lord of the Rings CD Key | Age of Conan gold | AoC US Gold | Cheap AoC Gold | Age of Conan Accounts | Age of Conan Power Leveling | Age of Conan Crafting Leveling | Age of Conan CD Key | Age of Conan EU Gold | Age of Conan Gold For Sale | Age of Conan Leveling | Age of Conan Accounts For Sale | AoC CD Key | The Chronicles of Spellborn Gold | Chronicles of Spellborn Gold | Chronicles of Spellborn Accounts | Chronicles of Spellborn Power Leveling | Chronicles of Spellborn CD key | atlantica gold | buy atlantica gold | atlantica power leveling | atlantica cd key | darkfall gold | buy darkfall gold | darkfall accounts | darkfall power leveling | darkfall cd key | silkroad gold | silkroad online gold | cheap silkroad gold | silkroad power leveling | Maple Story Mesos | Buy Maplestory Mesos | Maple Story Power Leveling | EVE ISK | EVE Online ISK | Cheap EVE ISK | EVE Power Leveling | EVE CD Key | EverQuest 2 Platinum | EverQuest 2 Gold | EQ2 Gold | EverQuest 2 Accounts | EverQuest 2 Power Leveling | EverQuest 2 CD Key
Anonymous said…
wow gold | world of warcraft gold | wow power leveling | Cheap WoW Gold | Cheapest WoW Gold | Buy Cheap WoW Gold | cheapest wow gold | Buy WoW Gold | sell wow gold | WoW Accounts | wow accounts for sale | Buy WoW Power Leveling | Wow Honor Leveling | WoW profession leveling | WoW Reputation Leveling | WoW CD Key | WOW EU Gold | Cheap WoW Gold | wow gold for sale | Cheap WoW Power Leveling | WoW EU Accounts | world of warcraft accounts for sale | WoW EU CD Key | Lineage 2 Adena | Buy L2 Adena | Lineage 2 Adena for sale | Lineage 2 Accounts | Lineage 2 Power Leveling | Lineage 2 CD Key | Warhammer gold | Buy Warhammer Gold | Warhammer US Gold | Warhammer Power leveling | Warhammer CD Key | Warhammer Accounts | Warhammer EU Gold | Buy Cheap Warhammer Gold | WAR EU Gold | Buy Warhammer Power Leveling | Warhammer Online Accounts | Warhammer EU CD key | Aion gold | fast delivery Aion Gold | Aion Accounts | Aion Power Leveling | Aion CD Key | runes of magic gold | cheap runes of magic gold | runes of magic accounts | runes of magic power leveling | runes of magic cd key | runes of magic online gold | buy runes of magic eu gold | wow cheats | rom power leveling | runes of magic eu accounts for sale | cheap runes of magic cd key | FFXI Gil | Cheap FFXI Gil | Final Fantasy XI Gil | FFXI Power Leveling | FFXI CD Key | LoTRO Gold | Cheap Lotro Gold | LoTRO US Gold | LoTRO Accounts | Lotro accounts for sale | LoTRO Power Leveling | LoTRO CD Key | LoTRO EU Gold | Lord of the Rings Gold | LoTRO EU Accounts | Lotro Leveling | Lord of the Rings CD Key | Age of Conan gold | AoC US Gold | Cheap AoC Gold | Age of Conan Accounts | Age of Conan Power Leveling | Age of Conan Crafting Leveling | Age of Conan CD Key | Age of Conan EU Gold | Age of Conan Gold For Sale | Age of Conan Leveling | Age of Conan Accounts For Sale | AoC CD Key | The Chronicles of Spellborn Gold | Chronicles of Spellborn Gold | Chronicles of Spellborn Accounts | Chronicles of Spellborn Power Leveling | Chronicles of Spellborn CD key | atlantica gold | buy atlantica gold | atlantica power leveling | atlantica cd key | darkfall gold | buy darkfall gold | darkfall accounts | darkfall power leveling | darkfall cd key | silkroad gold | silkroad online gold | cheap silkroad gold | silkroad power leveling | Maple Story Mesos | Buy Maplestory Mesos | Maple Story Power Leveling | EVE ISK | EVE Online ISK | Cheap EVE ISK | EVE Power Leveling | EVE CD Key | EverQuest 2 Platinum | EverQuest 2 Gold | EQ2 Gold | EverQuest 2 Accounts | EverQuest 2 Power Leveling | EverQuest 2 CD Key
I love the style, i have several similar one, i usually wear them to work or shopping. Please come visit my site red cross emergency when you got time.
Hey congrats on the new posting come out
btw i love your blog although i have just stumbled upon it =)
Love the new pictures you got there! Please come visit my site kitchen renovation give me any valuable feedbacks.
Anonymous said…
Hey congrats on the new posting come out
btw i love your blog although i have just stumbled upon it =)
Love the new pictures you got there! Please come visit my site guide to antique give me any valuable feedbacks.
Anonymous said…
love your blog! Very cool! Please come visit my site Trusts & Estate Planning when you got time.

Popular posts from this blog

UUID datatype and COPY IN/OUT support added to cvs

Hi all! It was just added support to uuid datatype in cvs head. This type will be available in next Postgresql release 8.3. Thanks to David Bachmann for his patch! You can get more info about this patch in this mailing list post . Also was added support for copy in and copy out operations. Now, users can provide streams which can be copied directly to and from Postgresql tables! Thanks to Kalle Hallivuori for providing a patch! Thanks to Truviso for giving support to Kalle. More info about that including a demo and ready to use compiled Npgsql.dll versions can be found here . That's it! As soon as we get more features added, I will post info about them here. Stay tuned! :)

Npgsql Tips: Using " in (...)" queries with parameters list and "any" operator

Hi, all! We have received some users questions about how to send a list of values to be used in queries using the "in" operator. Something like: select foo, bar from table where foo in (blah1, blah2, blah3); Npgsql supports array-like parameter values and the first idea to have this working would try to use it directly: NpgsqlCommand command = new NpgsqlCommand("select * from tablee where field_serial in (:parameterlist)", conn); ArrayList l = new ArrayList(); l.Add(5); l.Add(6); command.Parameters.Add(new NpgsqlParameter("parameterlist", NpgsqlDbType.Array | NpgsqlDbType.Integer)); command.Parameters[0].Value = l.ToArray(); NpgsqlDataReader dr = command.ExecuteReader(); but unfortunately this won't work as expected. Npgsql will send a query like this: select * from tablee where field_serial in ((array[5,6])::int4[]) And Postgresql will complain with the followin...

Using Entity Framework 6 with Npgsql 2.1.0

UPDATE (2014-05-19): Marek Beneš noticed a problem in the default connection factory config. It is fixed now. Thanks, Marek! UPDATE (2014-02-20): I created a new post explaining how to get Npgsql 2.1.0. Although this post is about EF 6, I'd like to talk about our current situation to support both EF 6 and EF4.x which explain why there are some subtle changes between EF 4.x and EF 6.x App.config settings.  Support for EF versions 4.x and 6.x Sometime after we started to work on Npgsql 2.1.0, we started to add code to support EF6 and decided to reorganize our Entity Framework support code. Shay created a pull request to organize this change and isolate the EF code out of core Npgsql code. The result was the creation of two separated assemblies: Npgsql.EntityFramework.dll for EF6 and above; Npgsql.EntityFrameworkLegacy.dll for EF4.x. Only when using Npgsql with EF6 you will need to reference Npgsql.EntityFramework.dll assembly. This is needed because the EF ...