Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2003-06-04 : 07:37:12
|
| Gayle writes "Using MSSQL 7 with SP3 on Windows 2000 Advanced Server. I am inserting records into a database (2 tables) from form fields on an asp page. I have form validation in place so that each field is required. I am getting instances where sometimes the only thing that makes it into the database is the datetime. I update/insert into 1 table, close my connection, re-open the connection and then update/insert into the 2nd table. I thought the problem might be with locks, but some of the suspect records occur between successful records with more than 1 minute between datetime. Any ideas on what would cause this? What if the user stopped in the middle of filling out the form and then came back several minutes later? Would this be a connection issue? Thanks!" |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2003-06-04 : 09:51:33
|
| If it's an ASP page, there is no connection while the user is filling out the form. This isn't client server.Run profiler on your server and see what is going on.Damian |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-06-04 : 12:23:10
|
| Are you doing error checking? Is it dynamic SQL or a stored procedure you're calling. Also why open and close a connection for each operation? Is that just more overhead?Brett8-) |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2003-06-04 : 20:11:26
|
| No it's actually better.Connections are pooled, so opening the second connection doesn't have all the overhead of the first.In ASP it is considered "best practice" to leave things open only for as long as you need them. The data layers I write for ASP open the database connection for each call.Damian |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-06-05 : 09:11:06
|
| yup, don't know what I was thinking, that how we do it here. Java opens (actually several) connections, and they stay open all the time until web sphere is recycled, or until I kill them.[homer] dooooh [/homer]Brett8-) |
 |
|
|
mohdowais
Sheikh of Yak Knowledge
1456 Posts |
Posted - 2003-06-05 : 09:50:23
|
quote: Java opens (actually several) connections, and they stay open all the time until web sphere is recycled, or until I kill them.
Is it really Java, or just lazy developers? Something I have learnt from you, Brett... most of the time its the developers/DBAs who are at fault rather than the products themselves (a la Oracle).Owais |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2003-06-05 : 10:08:00
|
| That is what an app server like web sphere does, is manage the connection pool.Damian |
 |
|
|
|
|
|
|
|