2011-06-23 17 views
0

我在最後幾天開發了一個用於測試我的架構的網頁(http://www.srtbox.com/),更多信息here。使用NoRM,MongoLab或MongoHQ進行數據庫託管。我在NoRM上遇到了很多錯誤。所有與Norm.BSON.BsonDeserializer類。我可以修復一個,但現在我在連接中出現一些錯誤。錯誤:NoSQL for Asp.Net我的NoRM和MongoDB經驗

System.Net.Sockets.SocketException A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count) at System.IO.BinaryReader.ReadBytes(Int32 count) at Norm.BSON.BsonDeserializer.Deserialize[T](BinaryReader stream, Int32 length)

事實是,該規範司機似乎真的不穩定......官方的驅動程序不提供支持LINQ和我沒有用POCO對象找到一個例子。有人對NoSQL數據庫和asp.net有很好的體會?像MongoDB一樣可擴展嗎? RavenDB似乎是一個不錯的選擇,但MongoDB有更多的成功案例,當然沒有.Net。

所以最大的問題是:您推薦哪種NoSQL可伸縮數據庫用於ASP.Net?你有沒有成功的故事?

PD:如果您訪問我的網站:(http://www.srtbox.com/)進行測試,我將非常感激。

回答

1

這看起來像一個網絡錯誤,而不是驅動程序的問題。如果數據庫不是本地的,你會看到如果你的連接不好,或者沒有正確設置防火牆 - 你可以在代碼中做不同的改變。試圖保持單個連接打開時間過長也會導致連接錯誤。

大多數可用的NoSQL數據庫都可以和.NET一起使用,因此您可以根據功能要求而不是.NET兼容性進行選擇。然而,你不應該指望它像SQL一樣工作,或者有很多例子 - 其中大多數主要用於其他平臺,並且因爲它們都有不同的查詢方式,所以LINQ並不總是很好的適合。

另外,POCO是什麼意思?序列化屬性可以使這些類看起來很複雜,但它們只是普通的對象,而不是從典型的ORM中獲得的惰性加載的自我更新對象。

+0

感謝您對POCO的問題。因爲我已經調查了更多的官方驅動程序及其支持POCO對象的真實性。我會嘗試。 – elranu