public IDbTransaction GetTransaction() {
if (this.isDisposed) {
throw new ObjectDisposedException("Session");
}
if (this.isComplete) {
throw new InvalidOperationException("Transaction was marked as completed, no further operations are permitted");
}
if (this.transaction == null) {
if (!this.isTransactionLess) {
this.transaction = this.GetConnection().BeginTransaction();
this.shouldCommitAndDisposeTransaction = true;
}
}
return this.transaction;
}