pekim/tedious — Issue #9: State still in SentClientRequest when 'done' event was fired
Author: baoshan
Created: 2012-01-20 11:52:43+00:00
State: open

When I try to benchmark a simple query as below:

```javascript
var i = 0;
var start = new Date;
var query = function () {
request = new Request("select top 100 cityid from dbo.cities", function(err) {
console.log('err', err);
});

request.on('row', function(columns) {
columns.forEach(function(column) {
});
});

request.on('done', function(rowCount, more) {
if(i++ < 200){
console.log('i:', i);
query();
}
else {
console.log(new Date - start);
}
});
connection.execSql(request);
};

connection.on('connect', function(err) {
// If no error, then good to go...
console.log('connection established');
query();
});
```

below exception was thrown:
```Invalid state; requests can only be made in the LoggedIn state, not the SentClientRequest state```