0
Blacula
8y

Was chilling with my team and remembering some very funny code issues (wasn't at the time) we inherited in a product... when we took control of the servers they were dead...

Code somewhat abbreviated... see why a few 100 of these could do that :)

public class Util
{

... lots of nonsense here...

public static DbConnection GetConnection()
{
conn = factory.CreateConnection();
conn.ConnectionString = this.connectionString;
conn.Open();
return conn;
}
}

try {
Util.GetConnection().DoThingsAndStuff();
}
finally {
Util.GetConnection().Close();
}

Comments
Add Comment