Just a quick question about usage of TransactionScope in ActiveRecord. Is this something that is used and works or do people use some other method of handling transactions. I am not familiar, and I am not working with AC but I am thinking about adopting SessionScope and TransactionScope for my project, and was just wondering what people think about it.
+1
A:
If you can use Windsor, I recommend using the ActiveRecordIntegration facility in combination with the Automatic Transaction Management Facility which allows you to apply transactions declaratively, e.g.:
using Castle.Services.Transaction;
[Transactional]
public class BusinessClass
{
public void Load(int id)
{
...
}
// note the "virtual"
[Transaction(TransactionMode.Requires)]
public virtual void Save(Data data)
{
...
}
}
Mauricio Scheffer
2010-01-06 19:02:21
No, I am not using Windsor, but was interested in their TransactionScope implementation. I was actually able to rip it out and use it in my project.
epitka
2010-01-06 21:15:42