Showing posts with label locked. Show all posts
Showing posts with label locked. Show all posts

Friday, March 30, 2012

If my ASP.Net application crashes just after HOLDLOCK is issued?

Will the database get locked if my ASP.Net application that is calling a stored procedure in which a HOLDLOCK for table1 is issued to SQL Server, suddenly crashes just after the stored procedure is called?

Holdlocks works on tables, pages, or rows it won't lock an entire database. If the commit and/or rollback is in the stored procedure, or contained in the batch sent to the SQL Server, then no. The batch and/or stored procedure will run to completion.

If you do something like issue this to the SQL Server: BEGIN TRANSACTION (Or start a transaction using the transaction object), then issue a SELECT ... (WITH HOLDLOCK) then crash before your ASP.NET application rollsback or commits the transaction, and the database server is remote, then yes, it'll be locked until the SQL Server realizes the connection is dead, and I'm not sure how long that would take. If it's a local SQL Server, then it realizes it immediate, and rollsback the transaction.

|||So, it seems that thesafestpractice as far as preventing SQL Server being held up in above scenario, is to provide rollbacks/commits inside stored proecedures rather than in ASP.Net code through ADO.Net.Is that correct?|||

Is it safest? Yes.

However, like I said, I haven't tested myself to see how long it will take SQL Server to detect a dead connection. It could be seconds, it could be hours. And it only really makes a difference if you are running in a web-farm environment, or you have other applications (that don't also run on the web server machine) that need access to the table data in a quick manner -- AND you can't tolerate the database to be down should a machine totally crash (Which is pretty darn rare). I would suggest that if you are deploying to such an environment you test this out yourself.

Friday, March 23, 2012

IE 7

Hi all,
I've installed IE 7 today and I don't why but I'm locked out of RS. I can
login but I can't see any report even if I'm admin on the machine ( laptop
with XP pro and SQL 2005 sp 1).
Anyone experienced this?
If anyone can help, it would be appriciated
FredYes,
Add your report server to your INTRANET zone (NOT THE TRUSTED ZONE).
If you add it to your trusted zone (or must) - you will need to make a
change - Open up Internet Properties (Control Panel) Then click the Advanced
Tab. Scroll down to security (at bottom) and make sure "Enabled Integrated
Windows Authentication" is checked.
Note: If you put your site in the INTRANET zone you do NOT need to do the
following steps)
Next, go to the security tab. Click the "Trusted Sites" icon - then click
the "Custom level..." button. Scroll down too the bottom and under the
section "User Authentication->Logon" make sure the bullet is set to what you
want - if you want automatic authentication select "Automatic logon with
current user name and password". If you wish to be prompted, choose "Prompt
for user name and password."
After making your changes, I suggest you restart.
Cheers!
=-Chris
"Fred" <Fred@.discussions.microsoft.com> wrote in message
news:3A2757B7-8736-4698-8192-A5A80C408594@.microsoft.com...
> Hi all,
> I've installed IE 7 today and I don't why but I'm locked out of RS. I can
> login but I can't see any report even if I'm admin on the machine (
> laptop
> with XP pro and SQL 2005 sp 1).
> Anyone experienced this?
> If anyone can help, it would be appriciated
> Fredsql