jnapier wrote:
So am I to assume that nobody is using Transactions for read only queries?
I definately do not.
Code:
public T Get<T>(object id)
{
return Session.Load<T>(id);
}
public void Save(object o)
{
BeginTransaction();
Session.SaveOrUpdate(o);
CommitTransaction();
}
Now, depending on your situation, if you're hitting SQL 2005 and using System.Transactions then, as long as you're not explicitly opening a transaction in NHibernate, it should stay as a lightweight transaction and not promote to a DTC-managed transaction.
That's probably the biggest performance hit in your scenario, promoting to the transaction manager for your given database platform...