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.
Unknown 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.
Unknown 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

Stream seek error

Hi all! Since Npgsql RC1, we started to receive some error reports about problems when closing connections. The typical stack trace looked like this: System.NotSupportedException : This stream does not support seek operations. at System.Net.Sockets.NetworkStream.Seek(Int64 offset, SeekOrigin origin) at System.IO.BufferedStream.FlushRead() at System.IO.BufferedStream.WriteByte(Byte value) − at Npgsql.NpgsqlQuery.WriteToStream(Stream outputStream) in C:\Npgsql\Npgsql2\src\Npgsql\NpgsqlQuery.cs:line 62 − at Npgsql.NpgsqlReadyState.QueryEnum(NpgsqlConnector context, NpgsqlCommand command) in C:\Npgsql\Npgsql2\src\Npgsql\NpgsqlReadyState.cs:line 64 − at Npgsql.NpgsqlConnector.ReleasePlansPortals() in C:\Npgsql\Npgsql2\src\Npgsql\NpgsqlConnector.cs:line 373 − at Npgsql.NpgsqlConnectorPool.UngetPooledConnector(NpgsqlConnection Connection, NpgsqlConnector Connector) in C:\Npgsql\Npgsql2\src\Npgsql\NpgsqlConnectorPool.cs:line 541 − at Npgsql.NpgsqlConnectorPool.ReleasePooledConnector(NpgsqlConn