DAA and CallRetrievalStoredProcedure

Posts   
 
    
mikeg22
User
Posts: 411
Joined: 30-Jun-2005
# Posted on: 30-Mar-2006 01:40:31   

When I make a new dataaccessadapter with 'new DataAccessAdapter(true)' and make a bunch of stored procedure calls, the DAA is not keeping the connection open between stored procedure calls as I thought it was supposed to do.

When I trace the code, the connection never actually gets opened, except for possibly inside 'adapter.Fill(dataSetToFill)'

Am I doing something wrong?

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 30-Mar-2006 03:34:23   

Can you post your code that is causing the behavior?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39930
Joined: 17-Aug-2003
# Posted on: 30-Mar-2006 15:02:14   

You should open the connection manually first, then do the calls then close it again. This is for procs only. Other LLBLGen Pro code leaves the open/close of the connection to the dataadapter used.

Frans Bouma | Lead developer LLBLGen Pro
mikeg22
User
Posts: 411
Joined: 30-Jun-2005
# Posted on: 30-Mar-2006 23:41:46   

Otis wrote:

You should open the connection manually first, then do the calls then close it again. This is for procs only. Other LLBLGen Pro code leaves the open/close of the connection to the dataadapter used.

I guess my question is why?

The connection object is protected within the DataAccessAdapter, so it makes this impossible to open it from the outside. How would you suggest doing this? Right now I've just changed the DAA template code to open the connection if it isn't already open inside CallRetrievalStoredProcedure.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 31-Mar-2006 08:35:04   

The connection object is protected within the DataAccessAdapter, so it makes this impossible to open it from the outside. How would you suggest doing this?

Using the DataAccessAdapter OpenConnection() method.

mikeg22
User
Posts: 411
Joined: 30-Jun-2005
# Posted on: 31-Mar-2006 21:22:13   

Walaa wrote:

The connection object is protected within the DataAccessAdapter, so it makes this impossible to open it from the outside. How would you suggest doing this?

Using the DataAccessAdapter OpenConnection() method.

Whoops! Missed that one sunglasses