So I got this error here, and at first I was spending a lot of time trying to figure out how to build NHibernate in mono so I could get line numbers in the output...
Code:
System.NullReferenceException: Object reference not set to an instance of an object
at NHibernate.Transaction.AdoTransaction.AfterTransactionCompletion (Boolean successful) [0x00000]
at NHibernate.Transaction.AdoTransaction.Commit () [0x00000]
.
.
.
After wasting time trying to get mdb's so I could find the line number in the NHibernate code, I figured I'd go look at the function to see if it offers any clues as to what was going on.
The function (In NHibernate.Transaction.AdoTransaction) throwing the nullreference is:
Code:
private void AfterTransactionCompletion(bool successful)
{
session.AfterTransactionCompletion(successful, this);
session = null;
begun = false;
}
And the only object being dereferenced anywhere is "session"
Which is where the impossible seems to come in... because in the call stack AfterTransactionCompletion is called directly from Commit which looks like this:
Code:
public void Commit()
{
CheckNotDisposed();
CheckBegun();
log.Debug("commit");
if (session.FlushMode != FlushMode.Never)
Session is being dereferenced just fine well before Commit gets around to calling AfterTransactionCompletion.
What does that mean? Is it some severe bug with mono? The code runs with no problems at all in Microsoft's development server. It doesn't seem like it can be a threading issue because it happens consistently. I am also looking at the code of the version that matches the binary version so It can't be that the code was modified in between.[/code]