Changeset 2117 for trunk/sources/HeuristicLab.DataAccess.ADOHelper
- Timestamp:
- 06/26/09 12:18:32 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.DataAccess.ADOHelper/3.2
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DataAccess.ADOHelper/3.2/HeuristicLab.DataAccess.ADOHelper-3.2.csproj
r2061 r2117 80 80 </ItemGroup> 81 81 <ItemGroup> 82 <Compile Include="VarBinaryStream.cs" /> 82 83 <Compile Include="Properties\AssemblyInfo.cs" /> 83 84 <Compile Include="DataAccessADOHelperPlugin.cs" /> -
trunk/sources/HeuristicLab.DataAccess.ADOHelper/3.2/Session.cs
r2096 r2117 42 42 private Thread ownerThread; 43 43 44 private int counter;44 private int usageCounter = 0; 45 45 46 46 private IDictionary<Guid, object> adapters = … … 50 50 this.factory = factory; 51 51 this.ownerThread = Thread.CurrentThread; 52 this. counter = 0;52 this.usageCounter = 0; 53 53 } 54 54 … … 74 74 75 75 public void IncrementUsageCounter() { 76 this. counter++;76 this.usageCounter++; 77 77 } 78 78 79 79 #region ISession Members 80 public ISessionFactory Factory { 81 get { 82 return this.factory; 83 } 84 } 85 80 86 public ITransaction BeginTransaction() { 81 87 CheckThread(); … … 85 91 transaction.Connection = Connection; 86 92 } 93 94 transaction.IncrementUsageCounter(); 87 95 88 96 return transaction; … … 134 142 135 143 public void EndSession() { 136 this. counter--;144 this.usageCounter--; 137 145 138 if ( counter <= 0) {146 if (usageCounter <= 0) { 139 147 CheckThread(); 140 148 -
trunk/sources/HeuristicLab.DataAccess.ADOHelper/3.2/TableAdapterWrapperBase.cs
r1720 r2117 36 36 new AdapterT(); 37 37 38 private ISession session;38 private Session session; 39 39 40 40 #region IDataAdapterWrapper<AdapterT,ObjT,RowT> Members … … 57 57 58 58 public Session Session { 59 protected get { 60 return this.session; 61 } 62 59 63 set { 60 64 this.session = value; -
trunk/sources/HeuristicLab.DataAccess.ADOHelper/3.2/Transaction.cs
r1529 r2117 34 34 private Session session; 35 35 36 private int usageCounter = 0; 37 36 38 public Transaction(Session session) { 37 39 this.session = session; 40 } 41 42 public void IncrementUsageCounter() { 43 this.usageCounter++; 38 44 } 39 45 … … 56 62 this.session.CheckThread(); 57 63 58 if (transaction != null) { 64 usageCounter--; 65 66 if (transaction != null && usageCounter <= 0) { 59 67 DbConnection conn = 60 68 transaction.Connection; … … 73 81 public void Rollback() { 74 82 this.session.CheckThread(); 83 84 usageCounter = 0; 75 85 76 86 if (transaction != null) {
Note: See TracChangeset
for help on using the changeset viewer.