Wednesday, March 21, 2012
Out of connections... or am I?
Then I try connecting, simultaneously, from a simple ASP.net thing I wrote just for testing and this works fine. So, then the connection pool can't be full, can it? Or, does each application have its own pool??The application has its own pool. I have run into this before. Check through the .net application to make sure you closed all the connections.|||Check through the .net application to make sure you closed all the connections.I thought .Net did all this for you?|||From what I've understood, the Garbage Collector closes connections, but it might take some while before it does it. And I'm not sure that it can take care of all the relevant connections.
About my problem; it seems to work now after having changed the application to log in as an other user. Could it have been caused by some other error in the user/login setup?|||I imagine the Garbage Collector will close connections after the application exits, but when does a web application exit? The connections are sitting in the pool, and the close connection is what releases the connection back to the pool to be used again. Another annoying thing to note is that a connection is only reusable by other connection objects only if they share the same connection string. I think under ADO differences in the order of attributes made for two separate connection pools, but I am not sure, now.|||I noticed now that as soon as I re-save the config file read by IIS for this application, the application removes all the sleeping connections and it works fine, until a 100 connections limit is reached again. (Increasing the 100 threshold would just postpone the problem.)
Killing all the processes from within SQL Server doesn't help.|||what I learned from my brief stint as a java programmer was to never trust the garbage collectors and to always DIY. people poke fun at me for explicitly dropping temp tables in SQL but it all comes from this experience.
I wonder if this has some connection to a limitation with SQLExpress. I do not know for certain.
Monday, March 12, 2012
osql versus stored procedural using in a web service
this′s used by aspx page) because i get a timeout expired or this stored
procedural is very very very slowly (more than 30 minutes). Although if i use
the console and osql this stored procedural runs very very quickly (some
seconds).
Can i do somethings?
Regards, and thank very much,
Hello,
Perheaps you can try with SET FORCEPLAN
to be sure that sql server will take the correct plan
Marc Allard
Allcomp
"fravelgueAThotmailDOTcom"
<fravelgueAThotmailDOTcom@.discussions.microsoft.co m> a crit dans le message
de news: E02F7AAB-7EAE-4CA7-80B1-5A88FB2A85EF@.microsoft.com...
>I have many problems with the stored procedural used at web service (and
> thiss used by aspx page) because i get a timeout expired or this stored
> procedural is very very very slowly (more than 30 minutes). Although if i
> use
> the console and osql this stored procedural runs very very quickly (some
> seconds).
> Can i do somethings?
> Regards, and thank very much,
|||hi,
"Allcomp" <fa097770@.nospam.skynet.be> ha scritto nel messaggio
news:uaPZusetEHA.2300@.TK2MSFTNGP09.phx.gbl
> Hello,
> Perheaps you can try with SET FORCEPLAN
> to be sure that sql server will take the correct plan
SET FORCEPLAN will instuct the query optimizer to execute the join
condition(s) in the (manual) order they are presented by the developer, and
I'd be very carefull in it's use...
as oSql.exe executes the very same query in short time, I'd rather think the
problem should be bound to the web service it self or elsewhere in the
connection...
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||"Andrea Montanari" wrote:
> hi,
> "Allcomp" <fa097770@.nospam.skynet.be> ha scritto nel messaggio
> news:uaPZusetEHA.2300@.TK2MSFTNGP09.phx.gbl
> SET FORCEPLAN will instuct the query optimizer to execute the join
> condition(s) in the (manual) order they are presented by the developer, and
> I'd be very carefull in it's use...
> as oSql.exe executes the very same query in short time, I'd rather think the
> problem should be bound to the web service it self or elsewhere in the
> connection...
Can you help me more?
I have changed timeout of web.config and and i set the connect timeout,
but i don′t know how i can do it
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
|||hi,
"fravelgueAThotmailDOTcom"
> Can you help me more?
> I have changed timeout of web.config and and i set the connect
> timeout, but i don′t know how i can do it
actually not... I'm very bad on web tihgs =;-D
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
Friday, March 9, 2012
osql timeout
I have several big tables with rows more than 25 mil rows
and to update/delete/insert data in these tables,
it can take minutes.
I use BULK Insert/DELETE/Update with osql.
While I run one of these updates,
if I try to select, it seems like both read and write get locked.
Shouldn't SQL resolve this kind of locking?
I left these to see if it gets resolved but both never returned.
So I need to kill these processes.
Does anyone have any scripts to find how long queries are running?
Also I need to make osql timeout and tried -t but it didn't work.
I used -t 1200 with DELETE in osql but it was running for more than 40
minutes. So I killed it and ran DBCC DBREINDEX on the table and re-ran
it and it worked.
Shouldn't the query get killed after 10 minutes?
What is exactly -t option for ?
thanks,(second714@.hotmail.com) writes:
> I have several big tables with rows more than 25 mil rows
> and to update/delete/insert data in these tables,
> it can take minutes.
> I use BULK Insert/DELETE/Update with osql.
> While I run one of these updates,
> if I try to select, it seems like both read and write get locked.
> Shouldn't SQL resolve this kind of locking?
If they are deadlocked, that is waiting for each other, SQL Server should
indeed detect this situation, and select one of them as a deadlock
victim.
But it may be the case that the first process is blocked by something
else, and when you try to select, the SELECT statement is blocked by
the update.
I have a tool on my web site, aba_lockinfo, which is good for looking
at locking chains. You can get it at
http://www.sommarskog.se/sqlutil/aba_lockinfo.html.
> Does anyone have any scripts to find how long queries are running?
You cannot really get the time how long a certain query has been
running, but you can see when a process last submitted a batch. The
latter is included in the information returned by aba_lockinfo.
> Also I need to make osql timeout and tried -t but it didn't work.
> I used -t 1200 with DELETE in osql but it was running for more than 40
> minutes. So I killed it and ran DBCC DBREINDEX on the table and re-ran
> it and it worked.
> Shouldn't the query get killed after 10 minutes?
> What is exactly -t option for ?
I didn't have the patience to try -t 1200, but I did try this:
E:\temp>osql -E -t 10
1> WAITFOR DELAY '00:00:20'
2> go
Timeout expired
So it does seem to work. I can't say why your DELETE did not timeout, but
it might be that it has to rollback the deletion that far, and rolling
back takes longer time than executing the command.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thanks for the info!
I'll try aba_lockinfo and test timeout more with select.
thanks again,