Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / RunTime / Hosting / WorkflowTransactionService.cs / 1305376 / WorkflowTransactionService.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- #region Using directives using System; using System.Transactions; #endregion namespace System.Workflow.Runtime.Hosting { public abstract class WorkflowCommitWorkBatchService : WorkflowRuntimeService { public delegate void CommitWorkBatchCallback(); virtual internal protected void CommitWorkBatch(CommitWorkBatchCallback commitWorkBatchCallback) { Transaction tx = null; if (null == Transaction.Current) tx = new CommittableTransaction(); else tx = Transaction.Current.DependentClone(DependentCloneOption.BlockCommitUntilComplete); try { using (TransactionScope ts = new TransactionScope(tx)) { commitWorkBatchCallback(); ts.Complete(); } CommittableTransaction committableTransaction = tx as CommittableTransaction; if (committableTransaction != null) committableTransaction.Commit(); DependentTransaction dependentTransaction = tx as DependentTransaction; if (dependentTransaction != null) dependentTransaction.Complete(); } catch (Exception e) { tx.Rollback(e); throw; } finally { if (tx != null) { tx.Dispose(); } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NativeMethods.cs
- Relationship.cs
- GeneratedView.cs
- MetadataImporter.cs
- GroupLabel.cs
- Profiler.cs
- StylusEventArgs.cs
- GCHandleCookieTable.cs
- SqlDependencyUtils.cs
- ObjectDataSourceStatusEventArgs.cs
- cookiecollection.cs
- ClientConfigurationHost.cs
- MSAAWinEventWrap.cs
- BamlLocalizableResource.cs
- CodeDelegateInvokeExpression.cs
- ClrPerspective.cs
- CodeTypeMember.cs
- OdbcDataReader.cs
- MergeFailedEvent.cs
- SafeFileMappingHandle.cs
- SplayTreeNode.cs
- DetailsViewModeEventArgs.cs
- DateTimeValueSerializerContext.cs
- TreeBuilderXamlTranslator.cs
- propertyentry.cs
- TextContainerHelper.cs
- InputBindingCollection.cs
- DbConnectionOptions.cs
- BlockExpression.cs
- CodeBlockBuilder.cs
- SocketInformation.cs
- PathBox.cs
- ObjectStateManager.cs
- OleDbPropertySetGuid.cs
- DrawingImage.cs
- InstanceView.cs
- WpfMemberInvoker.cs
- PropertyDescriptorComparer.cs
- DataGridViewRow.cs
- ImportContext.cs
- _ConnectStream.cs
- Control.cs
- SortAction.cs
- RuntimeConfig.cs
- ComboBoxRenderer.cs
- CapabilitiesPattern.cs
- RemotingException.cs
- XmlWriter.cs
- Pointer.cs
- DbConnectionStringCommon.cs
- SqlXml.cs
- RTLAwareMessageBox.cs
- ImageCollectionEditor.cs
- SafeNativeMethods.cs
- NameHandler.cs
- SiteMapProvider.cs
- wgx_commands.cs
- PositiveTimeSpanValidatorAttribute.cs
- HttpHandlersSection.cs
- HtmlInputHidden.cs
- NameGenerator.cs
- CompilerErrorCollection.cs
- CompilerError.cs
- SignatureHelper.cs
- ButtonFieldBase.cs
- FixedSOMFixedBlock.cs
- DateTimeSerializationSection.cs
- TableLayoutStyleCollection.cs
- EditorZone.cs
- WsatConfiguration.cs
- ProxyFragment.cs
- DataGridViewComboBoxColumn.cs
- DataGridSortCommandEventArgs.cs
- SqlRetyper.cs
- TraceEventCache.cs
- PersonalizableTypeEntry.cs
- BlockCollection.cs
- InputLanguageEventArgs.cs
- SQLRoleProvider.cs
- UnaryExpressionHelper.cs
- DataGridViewCellStyleConverter.cs
- Vector.cs
- FieldBuilder.cs
- DetailsViewDeleteEventArgs.cs
- validationstate.cs
- BaseParser.cs
- wmiutil.cs
- TextTreeTextNode.cs
- RichTextBoxConstants.cs
- TextDecorationCollectionConverter.cs
- filewebrequest.cs
- ACE.cs
- BlurBitmapEffect.cs
- EntryPointNotFoundException.cs
- Facet.cs
- SettingsBase.cs
- OutputCacheModule.cs
- WindowsNonControl.cs
- GradientStopCollection.cs
- KeyEventArgs.cs