- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Admin
The DAO waits for the caller to finish iterating the result set before closing the connection. If the caller does lengthy processing on the entity, the connection will linger for quite a while. If the caller never walks through the entire result set (intended or not), connection leaks.
IMHO, it is sensible to return a collection such that the connection can be closed/released back to pool ASAP.
IMNSHO, "Reading One Row At a Time!" is a moot point coz AFAIK most drivers read in chunks as default behaviour anyway.
Admin
Admin
Right, I remember that my ex-PHB once ordered me to insert half million records into production. I have to break it into chunks of several thousands each.
And I've seen morons who fail to grasp concepts such as predicated join or SELECT COUNT(*)...
Admin
I once used a certain application builder which worked fine with its own multiuser database but wasn't so happy when forced to connect to SQL server, since at the time it only supported one connection so you could never read just one row at a time, otherwise you would get the dreaded "Connection is busy with results for another HSTMT" error. The workaround was to configure the front end automatically download every result set ever queried in full. (I always did wonder how locking was supposed to work with multiple connections. In particular, how do you update the rows as you are reading them one at a time?)
(TDWTF decided that the background gradient on my CAPTCHA should run from black to deep red. Fortunately clicking Preview recolours it.)
Admin
row by row = slow by slow
From Mr Tomas Kyte, the great man himself.
Admin
He should switch back to Btrieve. It's reading one row at a time!
We actually have a wrapper in our legacy program that simulates Btrieve in SQLServer. (Back in the days, the system was written in Btrieve and they didn't want to change all the programs that where writter to read one row at a time. Still today, where stuck with it...)
Admin
Try the following code, the behaviour is different to what you claim, certainly in Oracle and SQL Server. Sorry it's T-SQL, too lazy to startup my Oracle VM.