diff options
author | Bernard Normier <bernard@zeroc.com> | 2007-06-01 23:01:01 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2007-06-01 23:01:01 +0000 |
commit | aba428c2e21eb34f8580804d471c19a208c8c813 (patch) | |
tree | ea0a9510a719b9e189eeddfebf0bf425075d1176 /cpp/src/Freeze/TransactionalEvictorI.cpp | |
parent | Replace isMulticast with macro (diff) | |
download | ice-aba428c2e21eb34f8580804d471c19a208c8c813.tar.bz2 ice-aba428c2e21eb34f8580804d471c19a208c8c813.tar.xz ice-aba428c2e21eb34f8580804d471c19a208c8c813.zip |
More transactional evictor testing
Diffstat (limited to 'cpp/src/Freeze/TransactionalEvictorI.cpp')
-rw-r--r-- | cpp/src/Freeze/TransactionalEvictorI.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/cpp/src/Freeze/TransactionalEvictorI.cpp b/cpp/src/Freeze/TransactionalEvictorI.cpp index 74b9214c291..278f37bc027 100644 --- a/cpp/src/Freeze/TransactionalEvictorI.cpp +++ b/cpp/src/Freeze/TransactionalEvictorI.cpp @@ -64,8 +64,7 @@ Freeze::TransactionalEvictorI::TransactionalEvictorI(const ObjectAdapterPtr& ada const vector<IndexPtr>& indices, bool createDb) : EvictorI<TransactionalEvictorElement>(adapter, envName, dbEnv, filename, facetTypes, initializer, indices, createDb), - _currentEvictorSize(0), - _rollbackOnUserException(false) + _currentEvictorSize(0) { class DipatchInterceptorAdapter : public Ice::DispatchInterceptor @@ -88,6 +87,11 @@ Freeze::TransactionalEvictorI::TransactionalEvictorI(const ObjectAdapterPtr& ada }; _interceptor = new DipatchInterceptorAdapter(this); + + string propertyPrefix = string("Freeze.Evictor.") + envName + '.' + _filename; + + _rollbackOnUserException = _communicator->getProperties()-> + getPropertyAsIntWithDefault(propertyPrefix + ".RollbackOnUserException", 0) != 0; } @@ -95,7 +99,16 @@ TransactionPtr Freeze::TransactionalEvictorI::getCurrentTransaction() const { DeactivateController::Guard deactivateGuard(_deactivateController); - return _dbEnv->getCurrent()->transaction(); + + TransactionalEvictorContextPtr ctx = _dbEnv->getCurrent(); + if(ctx == 0) + { + return 0; + } + else + { + return ctx->transaction(); + } } void |