Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Core
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv31283/Data/Core
Modified Files:
ServiceDomainPlatformTransactionManager.cs
TxScopeTransactionManager.cs
Log Message:
SPRNET-773 - Unit tests for ServiceDomainTransactionManager
SPRNET-761 - Unit tests for TxScopePlatformTransactionManager, call 'IsExistingTransaction' method on ITransactionScopeAdapter in TxMgr impl
remove DataAdapterObject, was not used or implemented - cruft.
Index: ServiceDomainPlatformTransactionManager.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Core/ServiceDomainPlatformTransactionManager.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ServiceDomainPlatformTransactionManager.cs 4 Dec 2007 16:31:04 -0000 1.5
--- ServiceDomainPlatformTransactionManager.cs 4 Dec 2007 19:43:16 -0000 1.6
***************
*** 111,115 ****
protected override object DoGetTransaction()
{
! return new ServiceDomainTransactionObject();
}
--- 111,120 ----
protected override object DoGetTransaction()
{
! ServiceDomainTransactionObject txObject = new ServiceDomainTransactionObject();
! if (txAdapter != null)
! {
! txObject.ServiceDomainAdapter = txAdapter;
! }
! return txObject;
}
***************
*** 150,158 ****
{
SimpleServiceConfig serviceConfig = CreateServiceConfig(definition);
-
- if (txAdapter != null)
- {
- serviceDomainTxObject.ServiceDomainAdapter = txAdapter;
- }
//The context is created when we call Enter.
serviceDomainTxObject.ServiceDomainAdapter.Enter(serviceConfig);
--- 155,158 ----
Index: TxScopeTransactionManager.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Core/TxScopeTransactionManager.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TxScopeTransactionManager.cs 30 Nov 2007 18:38:46 -0000 1.4
--- TxScopeTransactionManager.cs 4 Dec 2007 19:43:16 -0000 1.5
***************
*** 50,54 ****
/// </summary>
/// <remarks>This is indented only for unit testing purposes and should not be
! /// called by application code.</remarks>
/// <param name="txAdapter">The tx adapter.</param>
public TxScopeTransactionManager(ITransactionScopeAdapter txAdapter)
--- 50,54 ----
/// </summary>
/// <remarks>This is indented only for unit testing purposes and should not be
! /// called by production application code.</remarks>
/// <param name="txAdapter">The tx adapter.</param>
public TxScopeTransactionManager(ITransactionScopeAdapter txAdapter)
***************
*** 71,75 ****
protected override object DoGetTransaction()
{
! return new PromotableTxScopeTransactionObject();
}
--- 71,81 ----
protected override object DoGetTransaction()
{
! PromotableTxScopeTransactionObject txObject = new PromotableTxScopeTransactionObject();
!
! if (txAdapter != null)
! {
! txObject.TxScopeAdapter = txAdapter;
! }
! return txObject;
}
***************
*** 97,102 ****
protected override object DoSuspend(object transaction)
{
! // Passing the current TxScopeAdapter as the 'suspended resource, even though DoResume has no need to operate
! // on this object as it is handled internally inside TransactionScope.
PromotableTxScopeTransactionObject txMgrStateObject = (PromotableTxScopeTransactionObject) transaction;
return txMgrStateObject.TxScopeAdapter;
--- 103,109 ----
protected override object DoSuspend(object transaction)
{
! // Passing the current TxScopeAdapter as the 'suspended resource', even though it is not used just to avoid passing null
! // TxScopeTransactionManager is not binding any resources to the local thread, instead delegating to
! // System.Transactions to handle thread local resources.
PromotableTxScopeTransactionObject txMgrStateObject = (PromotableTxScopeTransactionObject) transaction;
return txMgrStateObject.TxScopeAdapter;
***************
*** 167,171 ****
}
! private void DoTxScopeBegin(PromotableTxScopeTransactionObject transaction,
Spring.Transaction.ITransactionDefinition definition)
{
--- 174,178 ----
}
! private void DoTxScopeBegin(PromotableTxScopeTransactionObject txObject,
Spring.Transaction.ITransactionDefinition definition)
{
***************
*** 173,188 ****
TransactionScopeOption txScopeOption = CreateTransactionScopeOptions(definition);
TransactionOptions txOptions = CreateTransactionOptions(definition);
!
! if (txAdapter != null)
! {
! txAdapter.CreateTransactionScope(txScopeOption, txOptions, definition.EnterpriseServicesInteropOption);
! transaction.TxScopeAdapter = txAdapter;
! }
! else
! {
! //TransactionScope txScope = new TransactionScope(txScopeOption, txOptions, definition.EnterpriseServicesInteropOption);
! //transaction.TxScopeAdapter.TransactionScope = txScope;
! transaction.TxScopeAdapter.CreateTransactionScope(txScopeOption, txOptions, definition.EnterpriseServicesInteropOption);
! }
}
--- 180,184 ----
TransactionScopeOption txScopeOption = CreateTransactionScopeOptions(definition);
TransactionOptions txOptions = CreateTransactionOptions(definition);
! txObject.TxScopeAdapter.CreateTransactionScope(txScopeOption, txOptions, definition.EnterpriseServicesInteropOption);
}
|