boolean doWork ( long txnId , TransactionTask task ) { boolean retval = canAcceptWork ( ) ; if ( ! retval ) { return false ; } MpRoSiteContext site ; // Repair case if ( m_busySites . containsKey ( txnId ) ) { site = m_busySites . get ( txnId ) ; } else { if ( m_idleSites . isEmpty ( ) ) { MpRoSiteContext newSite = new MpRoSiteContext ( m_siteId , m_backend , m_catalogContext , m_partitionId , m_initiatorMailbox , m_poolThreadFactory ) ; m_idleSites . push ( newSite ) ; m_allSites . add ( newSite ) ; } site = m_idleSites . pop ( ) ; m_busySites . put ( txnId , site ) ; } site . offer ( task ) ; return true ; }
Attempt to start the transaction represented by the given task . Need the txn ID for future reference .