Subsonic 3.0 how to correctly close connection

subsonicsubsonic3

I'm using Subsonic 3.0.0.3 Active Directory.
During program work, opens many connections to MySQL data base. I can see this threads in MySQL Administrator.
I'm working with data base in this case:

var db = new DB();
var nClient = Enumerable.First(db.clients, c => c.id_client == cl.ID);
nClient.data = data;
nClient.Update();

another example

var nClient = new client { data= cl.data };
nClient.Save();

How should I correctly close connection to database? Or how to use only one connection to database?

Best Answer

It will close the connection straight way. SubSonic was designed to only open the connection when needed and close when finished.

If you want to use the same connection for several queries you need to look in to the batch query