Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/26/09 12:18:32 (15 years ago)
Author:
svonolfe
Message:

Streaming of Jobs and JobsResults directly from/to the DB (#680)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.DataAccess.ADOHelper/3.2/Transaction.cs

    r1529 r2117  
    3434    private Session session;
    3535
     36    private int usageCounter = 0;
     37
    3638    public Transaction(Session session) {
    3739      this.session = session;
     40    }
     41
     42    public void IncrementUsageCounter() {
     43      this.usageCounter++;
    3844    }
    3945
     
    5662      this.session.CheckThread();
    5763
    58       if (transaction != null) {
     64      usageCounter--;
     65
     66      if (transaction != null && usageCounter <= 0) {
    5967        DbConnection conn =
    6068          transaction.Connection;
     
    7381    public void Rollback() {
    7482      this.session.CheckThread();
     83
     84      usageCounter = 0;
    7585
    7686      if (transaction != null) {
Note: See TracChangeset for help on using the changeset viewer.