【问题标题】:SubSonic crash with MySQL providerSubSonic 与 MySQL 提供程序崩溃
【发布时间】:2010-02-28 23:43:58
【问题描述】:

我正在使用带有 ActiveRecord 的 Subsonic 3.0.0.3,针对 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 它会崩溃,我有点卡住了...

有什么想法吗?

【问题讨论】:

    标签: mysql subsonic subsonic3


    【解决方案1】:

    http://github.com/subsonic/SubSonic-3.0 获取了最新的源代码,似乎可以解决这个问题。 (我之前用的是从http://subsonicproject.com/Download下载的)

    【讨论】:

      猜你喜欢
      • 2017-10-01
      • 2021-05-15
      • 2013-08-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-18
      相关资源
      最近更新 更多