NPoco和PostgreSQL:PostgresException:53300:抱歉,已有太多客户

时间:2017-05-01 19:37:31

标签: postgresql npoco

NPoco和PostgreSQL:PostgresException:53300:抱歉,已有太多客户

当我浏览自己的网站allverse.co一段时间后,我收到此错误。这是项目:https://github.com/claysmith/allverse

每个控制器中的典型NPoco连接代码......

    private IDatabase _db = new Database(new NpgsqlConnection(Startup.Configuration["PostgresConn"]), DatabaseType.PostgreSQL, NpgsqlFactory.Instance); 

    private IDatabase GetDB()
    {
        return _db; 
    }

    public SomeFunc()
    {
        using(IDatabase db = GetDB())
        {
            try
            {
                article.id = (long)db.Insert(article); 
            }
            catch(Exception ex)
            {
                string m = ex.Message;
                string im = ex.InnerException.ToString(); 
            }
        }
     }

我是否需要增加postgresql连接,还是我不在某处关闭连接?谢谢。

0 个答案:

没有答案