OK, I've searched the forums for this and I still can't come up with a satisfying answer. In the old days, before component layer, If I had Orders and Customers, and I wanted to use a Transaction, I would do:
TransactionManager tm = new TransactionManager()
try
{
tm.open()
Customer customer = new Customer();
customer.firstName = bob;
DAL.DataRepository.CustomerProvider.Insert(tm,customer);
Order order1 = new Order()
order1.customerID = customer.ID;
order1.price = $500;
Order order2 = new Order()
order2.customerID = customer.ID;
order2.price = $2000;
DAL.DataRepository.OrderProvider.Insert(tm,order1);
DAL.DataRepository.OrderProvider.Insert(tm,order2);
tm.commit()
}
catch
{
tm.rollback()
}
(there might be some errors in that above code, its just for an example :- )
OK, that was the old days. I'm trying to use component layer now. I've read that "transactions are automically handled." I just dont see how if I used the component layer and called order.save() and cusomer.save() it would be able to make a transaction like the one above automatically. With the "save()" method on the component layer (Im using the service model) not accepting a transaction manager, how do I do this?
Thanks.