Rocky:
I noticed you included a "ConnectionManager" class in CSLA 3.5 for sharing database connections between objects. Is there any chance we'll see a similar "TransactionManager" class in a future version of CSLA? I've run into an unusual situation where I need to share, not a connection, but a transaction between editable root objects. (or is that functionality already there and I've missed it?)
Thanks,
Jason
True... but if you use the new TransactionScope object (in the System.Transactions namespace), or the TransactionalAttribute that's in the framework (which directs the DataPortal to use a TransactionScope), then you can let .NET automatically enlist your objects in an active transaction. This is the new "preferred approach" to transactional programming within .NET. And if you use the same connection, then the transaction is not promoted to a distributed one. It's this scenario that spawned the creation of the ConnectionManager class.
Having said that, if you need something similar for transactions, you could certainly create one yourself, using the ConnectionManager class as a model.
HTH
- Scott
This is not a bad idea though. While TransactionScope is the better model overall, it doesn't work with Oracle or other non-SQL Server databases, and people might need to resort to Manual transactions. In that case a TransactionManager would be helpful.
I'll add it to the wish list.
Thanks Rocky!
In the meantime, I'll research the "TransactionScope" you guys suggested.
Rocky – you mean TransactionScope will not work on Oracle
database unless you have “Oracle Services for Microsoft Transaction
Server” installed.
http://www.oracle.com/technology/tech/windows/ora_mts/index.html
Oracle Services for Microsoft Transaction Server
Oracle Services for MTS allow Oracle databases to be used as resource managers
in MTS-coordinated transactions, providing strong integration between Oracle
databases and MTS. The Oracle Services for MTS act as a proxy for the Oracle
database to the Microsoft Distributed Transaction Coordinator (MSDTC). As a
result, these services provide client-side connection pooling and allow client
components that leverage Oracle to participate in distributed transactions. In
addition, Oracle Services for MTS can operate with Oracle databases running on
any operating system, given that the services themselves are run on Windows.
Oracle
Services for MTS support Windows, COM, and .NET-based transactional
applications. They run on 32-bit and 64-bit Windows natively, including Windows
x64 and Windows Itanium.
From: RockfordLhotka
[mailto:cslanet@lhotka.net]
Sent: Tuesday, September 16, 2008 1:36 PM
To: Nermin Dibek
Subject: Re: [CSLA .NET] Rocky...new class in future release?
This is not a bad idea though. While TransactionScope is the better model
overall, it doesn't work with Oracle or other non-SQL Server databases, and
people might need to resort to Manual transactions. In that case a
TransactionManager would be helpful.
I'll add it to the wish list.
Copyright (c) Marimer LLC