2

Appharborアプリケーションにリンクされている完全に空のRavenHQデータベースがあります。データベースが現在使用しているスペースの量は、私のブロンズアカウントで使用可能な25MBのうち1.1MBです。以前、データベースにはレコードが含まれていましたが、ManagementStudioの「コレクションの削除」を使用してレコードを削除しました。

初めてsession.Store(myobject)を呼び出すとき、および.SaveChanges()を呼び出す前に、次のエラーが発生します。

System.InvalidOperationException: Url: "/docs/Raven/Hilo/AccItems"

Raven.Database.Exceptions.OperationVetoedException: PUT vetoed by Raven.Bundles.Quotas.Triggers.DatabaseSizeQoutaForDocumetsPutTrigger because: Database size is 45,347 KB, which is over the allowed quota of 25,600 KB. No more documents are allowed in.

さて、ドキュメントは確かにそれほど大きくないので、このエラーが何を意味するのかわかりません。特に、SaveChangesを呼び出してセッションを閉じていないので、その時点でデータベースにアクセスしたことはないと思います。 ()。何か案は?これがコード自体です。

    XDocument doc = XDocument.Parse(rawXml);
    var accItems = ExtractItemsFromFeed(doc);
    using (IDocumentSession session = _store.OpenSession())
    {
        var dbItems = session.Query<AccItem>().ToList();
        foreach (var item in accItems)
        {
            var existingRecord = dbItems.SingleOrDefault(x => x.Source == x.SourceId == cottage.SourceId);
            if (existingRecord == null)
            {
                session.Store(item);
                _logger.Info("Saved new item {0}.", item.ShortName);
            }
            else
            {
                existingRecord.ShortName = item.ShortName;
                _logger.Info("Updated item {0}.", item.ShortName);
            }
            session.SaveChanges();
        }
    }            

Any other comments about the style of this code would be most welcome, as I was unsure of the best way to approach the "update existing item or create if it isn't there" scenario.

4

1 に答える 1

2

The answer here was as follows.

RavenHQ support found that the database was indeed oversized, but it seemed that the size reported in the Appharbor-branded RavenHQ control panel was incorrect. I had filled up the database way over the limit with a previous faulty version of the code posted above, so the error message I received was actually correct.

Fixing this problem without paying to upgrade the database wasn't straightforward, as it's not possible to shrink the database. As I also wasn't able to delete my single Appharbor/RavenHQ database or create another one that left me with the choice of creating an entirely new Appharbor application, or registering directly with RavenHQ for a new account. I chose the latter. The RavenHQ-branded control panel is slightly different to the Appharbor one, in that it has the ability to create and delete databases.

So to summarize: there doesn't seem to be any benefit to using RavenHQ as an add-on to Appharbor - you might as well go and get a proper free RavenHQ account.

于 2012-06-21T15:46:22.847 に答える