デスクトップ アプリケーションと Web アプリケーションによって参照される共通の dll があります。メソッドの 1 つは、3 つのオブジェクトを作成し、それらをトランザクション内で DB に挿入します。
ただし、このメソッドを Web アプリケーションとデスクトップ アプリケーションから同時に呼び出すと、オブジェクトは 3by3 では挿入されません...それらの順序は混合されます (デスクトップ アプリケーションから 1 つ、次に Web アプリケーションから 1 つなど)。
私のコードは大丈夫ですか?マッピングや nhibernate cfg と関係がありますか? 事前にどうもありがとうございました。
Notifications not = new Notifications();
not.Notes = applicationName;
not.GeneratedTime = DateTime.Now;
using (var session = SessionManager.OpenSession())
using (var transaction = session.BeginTransaction())
{
// do what you need to do with the session
session.Save(not);
not = new Notifications();
not.Notes = applicationName;
not.GeneratedTime = DateTime.Now;
session.Save(not);
not = new Notifications();
not.Notes = applicationName;
not.GeneratedTime = DateTime.Now;
// do what you need to do with the session
session.Save(not);
transaction.Commit();
}