diff options
author | Bernard Normier <bernard@zeroc.com> | 2007-11-19 16:13:05 -0500 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2007-11-19 16:13:05 -0500 |
commit | a9b2a73a6c8897e84e5e64ee8b41fe17b06d3f54 (patch) | |
tree | eb1216068d7e9be1c1039f13953b2101f00aa60f /cpp/src/Freeze/TransactionalEvictorI.cpp | |
parent | Added IceSL makedist.py (diff) | |
download | ice-a9b2a73a6c8897e84e5e64ee8b41fe17b06d3f54.tar.bz2 ice-a9b2a73a6c8897e84e5e64ee8b41fe17b06d3f54.tar.xz ice-a9b2a73a6c8897e84e5e64ee8b41fe17b06d3f54.zip |
Fixed bug #2543
Diffstat (limited to 'cpp/src/Freeze/TransactionalEvictorI.cpp')
-rw-r--r-- | cpp/src/Freeze/TransactionalEvictorI.cpp | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/cpp/src/Freeze/TransactionalEvictorI.cpp b/cpp/src/Freeze/TransactionalEvictorI.cpp index 5ce3ed9dab6..8951cde8e0f 100644 --- a/cpp/src/Freeze/TransactionalEvictorI.cpp +++ b/cpp/src/Freeze/TransactionalEvictorI.cpp @@ -394,10 +394,11 @@ Freeze::TransactionalEvictorI::dispatch(Request& request) { servantHolder.init(ctx, current, store); } - catch(const DeadlockException&) + catch(const DeadlockException& dx) { + assert(dx.tx == ctx->transaction()); ctx->deadlockException(); - throw; + throw TransactionalEvictorDeadlockException(__FILE__, __LINE__, dx.tx); } sample = servantHolder.servant(); } @@ -496,6 +497,8 @@ Freeze::TransactionalEvictorI::dispatch(Request& request) do { + TransactionPtr tx; + try { if(ownCtx) @@ -504,7 +507,8 @@ Freeze::TransactionalEvictorI::dispatch(Request& request) } CtxHolder ctxHolder(ownCtx, ctx, _dbEnv); - + tx = ctx->transaction(); + try { TransactionalEvictorContext::ServantHolder sh; @@ -540,7 +544,7 @@ Freeze::TransactionalEvictorI::dispatch(Request& request) if(dispatchStatus == DispatchAsync) { // - // May throw DeadlockException + // May throw DeadlockException or TransactionalEvictorDeadlockException // ctx->checkDeadlockException(); @@ -565,9 +569,12 @@ Freeze::TransactionalEvictorI::dispatch(Request& request) // servant holder destructor runs here and may throw (if !rolled back) // } - catch(const DeadlockException&) + catch(const DeadlockException& dx) { - ctx->deadlockException(); + if(dx.tx == tx) + { + ctx->deadlockException(); + } throw; } catch(...) @@ -583,9 +590,20 @@ Freeze::TransactionalEvictorI::dispatch(Request& request) // commit occurs here (when ownCtx) // } - catch(const DeadlockException&) + catch(const DeadlockException& dx) { - if(ownCtx) + if(ownCtx && dx.tx == tx) + { + tryAgain = true; + } + else + { + throw TransactionalEvictorDeadlockException(__FILE__, __LINE__, dx.tx); + } + } + catch(const TransactionalEvictorDeadlockException& dx) + { + if(ownCtx && dx.tx == tx) { tryAgain = true; } @@ -594,7 +612,6 @@ Freeze::TransactionalEvictorI::dispatch(Request& request) throw; } } - } while(tryAgain); } |