UnitofWork issue

Posts   
 
    
hneste
User
Posts: 3
Joined: 17-Aug-2006
# Posted on: 17-Aug-2006 22:58:57   

I am using self servicing model and when I attempt to use the llblgenprodatasource with LivePersistence set to false I can't figure out how to use the Unitofwork.Commit method. How do I declare the Transaction that is required to be passed in as a parameter. I can't seem to find the namespace it belongs to. Any example of how to do this would be greatly appreciated.

Thanks

Steve

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 18-Aug-2006 08:41:46   

If LivePersistence is set to false, an event is raised which passes an event arguments object which contains the parameters for the fetch or save.

LivePersistence causes 3 events to be raised. One of them is:

PerformWork. This event is raised when ExecuteInsert/Update/Delete is called on the LLBLGenProDataSource control by a bound control. **The work is tracked in a UnitOfWork object which is available to you in the event arguments. **

In the PerformWorkEventArgs you will find a property called Uow

hneste
User
Posts: 3
Joined: 17-Aug-2006
# Posted on: 21-Aug-2006 20:01:15   

Thanks. I understand that aspect of it. The issue is the commit method. I can't seem to pass a transaction in as a parameter. How can I declare this. When I create an instance of iTransaction it tells me that I an usuing an unassigend variable. I can't seem to find the Transaction class (am I missing a namespace?). Any ideas?

Steve

Jessynoo avatar
Jessynoo
Support Team
Posts: 296
Joined: 19-Aug-2004
# Posted on: 21-Aug-2006 21:07:21   

Hi,

The Transaction object from the Helper classes is probably what you're looking for.