~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/transaction_services.cc

  • Committer: Joseph Daly
  • Date: 2010-10-21 01:59:17 UTC
  • mto: (1856.2.16 transaction_id_innodb)
  • mto: This revision was merged to the branch mainline in revision 1900.
  • Revision ID: skinny.moey@gmail.com-20101021015917-snhgopy82x1fwcch
rework names for retrieving current trans id

Show diffs side-by-side

added added

removed removed

Lines of Context:
438
438
 
439
439
uint64_t TransactionServices::getCurrentTransactionId(Session *session)
440
440
{
441
 
/*
442
441
  TransactionContext *trans= &session->transaction.stmt;
443
442
  TransactionContext::ResourceContexts &resource_contexts= trans->getResourceContexts();
444
 
*/
445
 
 
446
 
  if (global_resource_manager)
447
 
  {
448
 
    return global_resource_manager->getTransactionId(session);
449
 
  }
450
 
  return 0;
451
 
 
452
 
/* 
 
443
 
453
444
  if (resource_contexts.empty() == false)
454
445
  {
455
 
    for (TransactionContext::ResourceContexts::iterator it= resource_contexts.begin();
456
 
         it != resource_contexts.end();
457
 
         ++it)
458
 
    {
459
 
      ResourceContext *resource_context= *it;
460
 
 
461
 
      plugin::MonitoredInTransaction *resource= resource_context->getMonitored();
462
 
      if (resource->participatesInXaTransaction())
 
446
      for (TransactionContext::ResourceContexts::iterator it= resource_contexts.begin();
 
447
           it != resource_contexts.end();
 
448
           ++it)
463
449
      {
464
 
        return resource_context->getXaResourceManager()->getTransactionId(session);
 
450
        ResourceContext *resource_context= *it;
 
451
 
 
452
        plugin::MonitoredInTransaction *resource= resource_context->getMonitored();
 
453
        if (resource->participatesInXaTransaction())
 
454
        {
 
455
          return resource_context->getXaResourceManager()->getCurrentTransactionId(session);
 
456
        } 
 
457
        else 
 
458
        {
 
459
          if (global_resource_manager)
 
460
          {
 
461
            return global_resource_manager->getNewTransactionId(session);
 
462
          }
 
463
        }
465
464
      }
466
 
    }
467
465
  }
468
466
  return 0;
469
 
*/
470
467
}
471
468
 
472
469
/**