This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I am working on a product where we are gradually phasing out an existing DataAccessLayer and replacing it with LightSpeed (it is awesome to work with!). We use MSSqlServer as our DB. We have a few new tables for this release which we are accessing via LightSpeed. The old tables are still accessed via the old DAL. However, I am experiencing one area of difficulty, and that is Transactions. The old DAL creates a new transaction via System.Data.Common.DbConnection.CreateTransaction(). I am wondering whether there is some way for me to get the LightSpeed UnitOfWork to enlist into this transaction? Thanks in advance - Imtiaz |
|
|
No, LightSpeed manages its own connection. You can enlist it into a wider transaction scope however which would then promote this to be a distributed transaction across the two connections. Have a look at http://www.mindscapehq.com/documentation/lightspeed/Basic-Operations/Transactions for a basic example of this. Alternatively if you were able to have your old DAL have its ADO.NET command objects prepared by LightSpeed you can use IUnitOfWork.PrepareCommand() to have the command attached to the same connection that LightSpeed is using.
|
|
|
Hi Jeremy, Thanks very much! Wrapping both DAL methods around a System.Transactions.TransactionScope worked like a charm! Ta - Imtiaz |
|