Friday, April 20, 2007

In the days of old when we were building LOB mobile applications on SQL CE 2.0 (it seems like only the year before last (and it was) ).    We had the restriction of only a single connection to the database open at any time.

Our applications had to be written to ensure with ruthless efficiency that only one connection was open at any one time.       We coded that into our applications to ensure that we explicitly created, opened, closed and disposed a connection pretty much every time we issued a SQL command

Since we're now in the world where in SQL Compact, we can have multiple connections open to the database we don't have to be as rigid.    So to bring things up to date and change to using a singleton class for our database connection object,  we're even going for most cases keep the database connection open (how brave is that).      Our singleton class that keeps the database connection, will implement IDispose so we can clear up resources if things go wrong.

Yuri Fenyuk and Mike Holland (told you I'd mention you guys)  in my team have done some benchmarking and it looks like this is now the way to go.    The overhead on memory is negligible and certainly it seems really fast.   To hell with the safety of single connections I say....

 

Technorati tags: ,

Theme design by Jelle Druyts

Pick a theme: