4 Replies Latest reply on Jun 1, 2005 7:22 AM by Dimitris Andreadis

    TransactionLocalDelegateImpl

    Dimitris Andreadis Master

      A related question to my previous post, since I am there:

      TransactionLocalDelegateImpl as an alternative implementation of TransactionLocalDelegate, when a TransactionManager other than TxManager is used, uses the 'this' value rather than the 'unused' TransactionLocal reference, in all calls to the delegate TransactionLocalSynchronization instance (as seen below).

      This effectively means the HashMap in TransactionLocalSynchronization always stores a single object, no matter what TransactionLocal->Object association you want to make, within a transaction.

      Is this intentional or just forgotten?

      (the 'unused' name seems it's intentionall, but I don't understand why :)

      Thanks

       public Object getValue(TransactionLocal unused, Transaction tx)
       {
       TransactionLocalSynchronization sync = getSynchronization(tx, false);
       if (sync == null)
       return null;
       return sync.getValue(this);
       }
      
       public void storeValue(TransactionLocal unused, Transaction tx, Object value)
       {
       TransactionLocalSynchronization sync = getSynchronization(tx, true);
       sync.setValue(this, value);
       }
      
       public boolean containsValue(TransactionLocal unused, Transaction tx)
       {
       TransactionLocalSynchronization sync = getSynchronization(tx, false);
       if (sync == null)
       return false;
       return sync.containsValue(this);
       }