Skip to main content

Posts

Npgsql code moved to GitHub!

Since the beginning, in 2002, Npgsql has been using cvs as its source code management system (SCM). At the time, cvs was being used by a lot of opensource projects, and so it was a natural choice for Npgsql. A couple of days ago, Npgsql code moved to GitHub. I didn't blog about that in the same day because I wanted to make sure things went well before spreading the word. :) ( You may be asking yourself: But Npgsql code was already at GitHub, wasn't it? Yes, it was. But it was only a mirror of the main cvs repository. And I had to update the code manually every time. Every change had to go first to the main repository cvs and then I would update in GitHub. Obviously the code was often outdated. This is a thing of the past now.) Git was chosen mainly because there is a lot of documentation about it, it is powerful and because of GitHub. GitHub provides many resources which will help us have a much better environment for our collaborators and users. For our collaborat...

Better tracing of Npgsql connection pool usage in the works

Sometimes, Npgsql users receive errors when working with connection pooling. The problem appears when they try to open a new connection and receive the following message:   "Timeout while getting a connection from pool." This is caused when an attempt is made to get a connection from a pool which  has all its connections used. Most of the time this problem is a difficult one to track because it generally happens when the system is in production and not in the development phase. Of course. :) Some time ago, I received a report from Miłosz Kubański about such a problem. I told him I would work in a way to get more information so we could check what was happening. In order to help us find the problem, I added a little  "hack" to  Npgsql: Whenever an error while getting a connection from the pool occurs, Npgsql would log a stacktrace of the allocation of all the connections which were in the pool. Theoretically, those connections which were allo...

Where is vs.net design time support?

You may already know that VS.Net design time support has started a long time ago  and didn't have too much support since then.  Now that Npgsql release 2.0.12  is out, I want to put more attention to finish a version which adds design time support. I noticed that this is the biggest missing feature in Npgsql and I want to fix that. Npgsql users deserve to be able to use VS.Net design time support to help them create better apps which access Postgresql databases. Although I can't give any concrete timeframe of when it will be available, I want you to know that I'm focused on this feature and it is not stalled. I hope to be able to give you more information soon. Stay tuned.

ConnectionPool performance improvements

Hi, all! Today I committed a change to Npgsql which will improve connection pool performance. This change was motivated by Andrew's bug report where he noticed that a lot of threads were waiting to get a new connection from pool. In order to keep consistence of the pool, Npgsql has to lock access to it. Andrew's problem appeared in a busy server where a lot of threads were trying to get a new connection from the pool. They had to wait in line. And obviously this isn't good. The current implementation of Npgsql creates a big lock surrounding all the code needed to work with the pool and more! As Andrew noticed in his bug report, I/O operations were being done inside this lock which was contributing to more delays to get a connection from the pool. So, to fix that, I rewrote connection pool logic to remove this big lock and break it down to smaller ones only when really needed. All the I/O operations were left out of the locks , this way, other threads...

Npgsql2 source code mirror is now available on github

Hello, all! Npgsql2 source code hosted on pgfoundry  is now mirrored on github:  https://github.com/franciscojunior/Npgsql2 What does this mean to developers and users? You have another way of access to latest Npgsql2 code through github interface I hope it will be easier to developers and users to provide patches. You can make forks and pull requests. Please, if you weren't being able to access Npgsql2 source code because of cvs, please give it a try on this new interface and let me know if you have any problems. Thanks github for providing this service to open source community. 

Fixed! LOG: unexpected EOF on client connection

Hi all! Since we implemented connection pool in Npgsql, we received some complaints about EOF log messages being generated on Postgresql logs when using Npgsql. This was caused by Npgsql not sending the proper terminate message to Postgresql on pooled connections when the application terminated or more specifically when the assembly was unloaded. This is a long time problem with Npgsql connection pool. I even talked about it in the past . Up to now, I had no idea about how to fix that as I wasn't able to close the connections in the pool. When I tried to put a finalizer in NpgsqlConnectorPool, which would be triggered when the assembly was unloaded, I received object already disposed exceptions when trying to send something to the stream. That's when I came up with the "excellent" idea of subclassing the networkstream class and override its Dispose method so that I could send the postgresql terminate message before it was disposed! :) It worked like a charm! ...

Npgsql Design time support preview available for download!

UPDATE2 : For some reason, Blogger lost the original post. I had to republish it. UPDATE : Jerónimo told me that you  must  use the Npgsql version which is inside the zip file in order to make it work. After so much time (more than I wanted it to take) Npgsql finally has a initial design time support for Visual Studio! This work was done by Jerónimo Milea. Jerónimo let me know he was working on DDEX support on this thread  after I said I was working on DDEX support for Npgsql. He sent me his working copy and I started to play with it. Note that as a preview version many things may not work ok and we wanted you to provide us feedback so we can fix any bugs. You can download the project file from our downloads page . Design time support is provided as a zip file containing support code as well as a copy of Npgsql project file. So, everything you need to start working with design time support is already packaged for you. When you unzip the file, you will have ...