The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Connection is broken

Last post 06-23-2008, 5:23 AM by pycol. 2 replies.
Sort Posts: Previous Next
  •  06-22-2008, 5:31 AM 9931

    Connection is broken

    Hello,

    I'm having a random problem that appears to be with Npgsql.  Fairly often, when running code that accesses a db on a remote server, I get the error "The connection has been broken."  When I'm running through Npgsql directly I've found the solution to be to "ClearPool" before opening the connection.  I found this after researching errors with Npgsql.  And, it works.  However, when I'm using ES and I need to change the connection string I'm not aware of any way that I can force ES to do the same thing.  Perhaps there is and I'm missing it?  Has anyone else had this problem?

    Also, I'm not sure whether you planned it this way or not but I can change the ConnectionString each time before I do a Query.  This allows me to check the same table on both the remote server and the local machine using the same instance of the table object.  This is (at least for me - I came from the 8080 / 64k days so I hate to take any more memory then I have to) spectacular!  Is there any reason I shouldn't do this?

    Thank you for your help!  Great product!

    Phil Mickelson

  •  06-23-2008, 4:20 AM 9937 in reply to 9931

    Re: Connection is broken

    We currently have no API for such a thing. Is this with their new 2.0 beta? ClearPool() is kind of drastic and that it clears the connection pool I would think this would really slow things down? Of course, if you have to do it for a work around I understand. Other than using Npgsql directly in your application there is currently no way to do this. Do you have any kind of link to this on Npgsql.org (the bug) ?

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  06-23-2008, 5:23 AM 9940 in reply to 9937

    Re: Connection is broken

    Yes:  http://pgfoundry.org/forum/forum.php?thread_id=1303&forum_id=519

    I am using the 1.0 version.  I will update to a later version and see if that makes any difference.  However, I believe I moved back to the older version because this was happening on the new one too and I thought maybe it was just a problem there.

    It doesn't appear to slow things down too much and I only have to worry about it when I'm accessing a bunch of DBs.  I can go from DB to DB and do my updating in about a second or two max so it doesn't seem slow.  On the remote server I'm running a 64bit version of Win Server 2003 on a virtual server (who knows how many others are on the same machine) but I have to tell you, it is blinding fast!  I was running MySQL on that same machine doing the same tasks and Postgres is easily five to 10 times faster.  Why it isn't more popular I have no idea.

    Thanks!

    Phil

View as RSS news feed in XML