我将Subsonic 3.0.0.3与ActiveRecord一起使用,并针对MySQL数据库运行。我发现这很好用:

// Approach 1
var db = new testDB();
db.Insert.Into<company>(c => c.name) .Values("Acme") .Execute();


但这崩溃了:

// Approach 2
company c = new company();
c.name = "Acme";
c.Save();


崩溃不是立即发生的,而是在关机时发生的:

One of the background threads threw exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at MySql.Data.MySqlClient.NativeDriver.FetchDataRow(Int32 statementId, Int32 columns)
   at MySql.Data.MySqlClient.Driver.FetchDataRow(Int32 statementId, Int32 columns)
   at MySql.Data.MySqlClient.Driver.SkipDataRow()
   at MySql.Data.MySqlClient.ResultSet.Close()
   at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   at MySql.Data.MySqlClient.MySqlDataReader.Close()
   at MySql.Data.MySqlClient.MySqlConnection.Close()
   at MySql.Data.MySqlClient.MySqlConnection.Dispose(Boolean disposing)
   at System.ComponentModel.Component.Finalize()
Test host process exited unexpectedly.


鉴于方法1我无法弄清楚如何获取新插入的记录ID,方法2崩溃了,我有点卡住了...

有任何想法吗?

最佳答案

http://github.com/subsonic/SubSonic-3.0获取了最新的来源,似乎可以解决此问题。 (我以前使用的是http://subsonicproject.com/Download的下载文件)

关于mysql - SubSonic与MySQL提供程序一起崩溃,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/2353166/

10-10 14:49