Changeset 5057


Ignore:
Timestamp:
Aug 18, 2009, 2:46:43 PM (13 years ago)
Author:
Nicklas Nordborg
Message:

References #108: Logging the change history of an item

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/core/LogControl.java

    r5054 r5057  
    2222package net.sf.basedb.core;
    2323
     24import java.lang.ref.WeakReference;
     25
    2426import net.sf.basedb.core.data.ChangeHistoryData;
    2527import net.sf.basedb.core.data.ChangeHistoryDetailData;
     
    3739{
    3840
    39   private final DbControl dc;
     41  private final WeakReference<DbControl> dc;
    4042  private TransactionDetails transactionDetails;
    4143  private org.hibernate.StatelessSession session;
     
    4345  LogControl(DbControl dc)
    4446  {
    45     this.dc = dc;
     47    this.dc = new WeakReference<DbControl>(dc);
    4648  }
    4749 
     
    5456    if (transactionDetails == null)
    5557    {
    56       transactionDetails = new TransactionDetails(dc.getSessionControl());
     58      transactionDetails = new TransactionDetails(dc.get().getSessionControl());
    5759    }
    5860    return transactionDetails;
     
    110112  private org.hibernate.StatelessSession getSession()
    111113  {
    112     if (session == null) session = dc.getStatelessSession();
     114    if (session == null) session = dc.get().getStatelessSession();
    113115    return session;
    114116  }
Note: See TracChangeset for help on using the changeset viewer.