data access adapter pooling

Posts   
 
    
silky avatar
silky
User
Posts: 38
Joined: 03-Feb-2008
# Posted on: 12-Jul-2008 11:56:01   

I'm wondering about the internal functioning of the DataAccessAdapter class in the "adapter" mode.

LLBLGen Pro 2.0.0.0 (Final)

The typical use pattern for me is:

using(DataAccessAdapter adapter = new DataAccessAdapter()){
  // some stuff
}

So that is I open a new one each time I want to do something. Is this a wise approach? If I want to be performing thousands of these statements a minute am I better off pooling adapters and closing them when they aren't being used? Or some strategy like that? Or are the adapters pooling themselves, and can I just relax and be happy simple_smile

Thanks.

silky avatar
silky
User
Posts: 38
Joined: 03-Feb-2008
# Posted on: 12-Jul-2008 13:01:06   

After a tiny bit of review I've decided that it doesn't. So I guess that leaves it to me to do the pooling.

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 12-Jul-2008 14:23:14   

ADO.NET performs connection pooling under the hood.

I think you'd better not keep an adapter around with an open connection. I don't think you need to do pooling for the adatpter instances.

What you can do to help performance is if you are doing multiple database interactions at a time is to use the same adapter while keeping the connection open until you finish.

using(DataAccessAdapter adapter = new DataAccessAdapter(true)) { // some stuff }

silky avatar
silky
User
Posts: 38
Joined: 03-Feb-2008
# Posted on: 13-Jul-2008 00:59:50   

Thanks walaa.