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.