Can i pass the adapter object to other page

Posts   
 
    
varthy
User
Posts: 1
Joined: 15-Mar-2006
# Posted on: 15-Mar-2006 10:48:57   

Hi,

I have created one DataAccessAdapter object "adapter" and started a Transaction with it... I have some part of my transaction in one web page and the rest in the next page. Now i want to pass the same adapter onject to the next page before comitting it... Can i pass that through URL parameter or save in a Session to use it next Page?

Or is there any other way to do this? I used the following code to start the transaction:

adapter.StartTransaction( IsolationLevel.ReadCommitted, "EnrollGateway" );

now i want the same adapter onject for two different pages which should come under the same transaction.

pls help me its very urgent..... Thanku

Varthy

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 15-Mar-2006 14:11:08   

You can pass the adapter object as a session variable or better as in the ViewState

Althogh it's not recommended to use a transaction across pages, which will be pending for user actions.

A transaction holds a connection to the database open till it commits.

Better to use a Unit Of Work object.

please refer to the LLBLGen Pro documentation "Using the Generated code -> Adapter -> Unit of work and field data versioning"