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)

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  
    8080  </ItemGroup>
    8181  <ItemGroup>
     82    <Compile Include="VarBinaryStream.cs" />
    8283    <Compile Include="Properties\AssemblyInfo.cs" />
    8384    <Compile Include="DataAccessADOHelperPlugin.cs" />
  • trunk/sources/HeuristicLab.DataAccess.ADOHelper/3.2/Session.cs

    r2096 r2117  
    4242    private Thread ownerThread;
    4343
    44     private int counter;
     44    private int usageCounter = 0;
    4545
    4646    private IDictionary<Guid, object> adapters =
     
    5050      this.factory = factory;
    5151      this.ownerThread = Thread.CurrentThread;
    52       this.counter = 0;
     52      this.usageCounter = 0;
    5353    }
    5454
     
    7474
    7575    public void IncrementUsageCounter() {
    76       this.counter++;
     76      this.usageCounter++;
    7777    }
    7878
    7979    #region ISession Members
     80    public ISessionFactory Factory {
     81      get {
     82        return this.factory;
     83      }
     84    }
     85
    8086    public ITransaction BeginTransaction() {
    8187      CheckThread();
     
    8591         transaction.Connection = Connection;
    8692      }
     93
     94      transaction.IncrementUsageCounter();
    8795
    8896      return transaction;
     
    134142
    135143    public void EndSession() {
    136       this.counter--;
     144      this.usageCounter--;
    137145
    138       if (counter <= 0) {
     146      if (usageCounter <= 0) {
    139147        CheckThread();
    140148
  • trunk/sources/HeuristicLab.DataAccess.ADOHelper/3.2/TableAdapterWrapperBase.cs

    r1720 r2117  
    3636      new AdapterT();
    3737
    38     private ISession session;
     38    private Session session;
    3939   
    4040    #region IDataAdapterWrapper<AdapterT,ObjT,RowT> Members
     
    5757
    5858    public Session Session {
     59      protected get {
     60        return this.session;
     61      }
     62
    5963      set {
    6064        this.session = value;
  • 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.