views:

106

answers:

1

I'm using Subsonic 3.0.0.3 with ActiveRecord, running against a MySQL database. I'm finding that this works fine:

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

But this crashes:

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

The crash is not immediate, but on shutdown:

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.

Given that with approach 1 I can't figure out how to get the newly inserted record ID and with approach 2 it crashes, I'm a little stuck...

Any ideas?

+2  A: 

Grabbed the latest source from http://github.com/subsonic/SubSonic-3.0 which seems to fix this. (I was previously using the download from http://subsonicproject.com/Download)

cantabilesoftware