Re: How to handle transactions across root objects

Re: How to handle transactions across root objects

Old forum URL: forums.lhotka.net/forums/t/3316.aspx


alef posted on Thursday, August 02, 2007

Hello Joe,

The recommendation for the Command Object I've followed. My code I've written is based on your solution. I've find many posts from you. But the difficulty about my question is that the transaction is across root objects but there is a dependency. First I need to save the roles, recuperate the identity values for the roles from the database and then do the saving of the project with his projectresources.

So it is the following part of the code which is not correct. How can I transfer the identity value for the roles to the project?

[Transactional(TransactionalTypes.TransactionScope)]

protected override void DataPortal_Execute()

{

if (_roles != null)

_roles  = _roles.Save();

if (_project!= null)

_project= _project.Save();

}

Copyright (c) Marimer LLC