There's nothing better than being called up at 4:30 in the morning to solve a production crisis. Well, aside from sleeping. Or baking. Or antique furniture restoration. But nonetheless, Alexander Shirshov was called in to help increase the SQL Server connection pool size. It would seem the backend to their retail inventory system kept generating error messages:

Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.

The culprit as it turns out was a developer who pushed some optimized code in the report printing modules to ensure that "precious resources are released." Of course, it would probably be a good idea to release these well before starting a 2-3 minute print job that's called throughout the night ...

using(SqlConnection connHSB = DbAccess.GetConnection())
    using(SqlCommand cmdHSB = DbAccess.GetStoreProcedure("CreateReceipt", 
new SqlParameter("@ReceiptNO", myReceiptDetail.receiptNO),
new SqlParameter("@CompanyID", CompanyID.ToString()))) { using(SqlDataAdapter daHSB = new SqlDataAdapter(cmdHSB)) { using(dsReport dsHSB = new dsReport()) { cmdHSB.CommandTimeout = 300; cmdHSB.Connection = connHSB; connHSB.Open(); daHSB.Fill(dsHSB,"CreateReceipt"); rptHSB2 HSBReport = new rptHSB2(); HSBReport.Database.Tables["CreateReceipt"].SetDataSource(dsHSB); HSBReport.PrintOptions.PrinterName =@"\\"+lblIP.Text+@"\Epson"; HSBReport.PrintOptions.PaperSize= PaperSize.PaperEnvelopeC6; HSBReport.PrintToPrinter(1, true, 1, 999); } } } }

It seems that the efforts to create a logo have fallen off the radar. To revive this, a mug or tee goes to whomever finishes up the design. More Details ....

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!