How do COM+ transactions relate to SQL Server SPID?
I am trying to solve a deadlock issue. Using SQL trace, I find SPID 65 and 71 are trying to acquire resources that are locked by each other. But what I am confuse with is tasks performed by 65 are triggered by different transactions (same for 71). Should different COM+ transaction uses different SPID?
The entire COM+ application uses only one db login.
I got a deadlock scenario and so I took a snap shot of the syslockinfo table. I found out an interesting scenario where the deadlock is because of two transactions within the same spid.
For the first one the lock was granted(transactionID:96462284) but for the next one(transactionId:96594607) it was put in wait state and SQL server detected it as a deadlock.
I just wanted some clarifications. 1) what is the significance of req_transactionID column in syslockinfo table? 2) what is the relationship between req_transactionId column and spid column? 3) In case of nested transactions what will be the values of these 2 columns and what will be the relationship between them in that scenario? 4) In this case the deadlock is occurring while executing a SP(the nested level of calls go till 3rd level). 5) Will there be contention for locks between transactions within a single spid.
it is something like this: sp_cache sp_cache1 while sp_cache2 end while
the deadlock occurred when executing sp_cache 2. At that time there were only two transactionId values in the syslockinfo table for this spid,They were: 1) 96462284 2)96594607
If some body could please help me it would be really helpful for me.
Hi there, I have decided to move all my transaction handling from asp.net to stored procedures in a SQL Server 2000 database. I know the database is capable of rolling back the transactions just like myTransaction.Rollback() in asp.net. But what about exceptions? In asp.net, I am used to doing the following: <code>Try 'execute commands myTransaction.Commit()Catch ex As Exception Response.Write(ex.Message) myTransaction.Rollback()End Try</code>Will the database inform me of any exceptions (and their messages)? Do I need to put anything explicit in my stored procedure other than rollback transaction? Any help is greatly appreciated
I have a table cust_detail when ever there is an insert/update/delete in this table it is getting blocked and in turn its blocking other table inv_credit which is doing select statement.
I have a small doubt. In my server some processs are running slow. With out the use of profiler hw we can find the spid's that are running slow. is there any procedure for that.
I am seeing intermittent blocking problems. The strange part of it is,that the SPID listed in the Blk By column is the same as the SPID thatis being blocked.Has anyone seen this before, or have any idea what this may suggest?
Hi, Here i have a question.. Whenever i see my spid in LOCK/PROCESS ID one command DBCC BUFFERINPUT(MY SPID) always running and it is showing ''''tempdb.dbo.##lockinfo''' MODE---- X Is it pretty normal or something wrong.. i am not running any thing, just simply opened EM.. Pls any suggestions... thank u
I know that spid 22 is blocking 2 other users. How do I tell who that user is? Is this just matching the same spid# in the process info in EM and if it doesn't give me an NT name it's probably because they're coming through the application and I can't figure it out?
I have a spid that I'm not able to kill, this were a select statement from with in access 97 application using a DNS connection. So even that I reboot the client pc and kill the spid it still shows as active with status RollBack. We have similar problem before and the only way that it disappear were re - starting Sql. (system Sql 7.0 with sp1 and Access 97)
I have a problem. I am trying to kill a spid that is blocking updates to a table. The spid number is '-2'. I am using KILL with UOW and I am getting this error:
Server: Msg 6112, Level 16, State 1, Line 1 Distributed transaction with UOW {FCF8D536-27ED-11D6-9CF2-0002A56BDA54} is in prepared state. Only Microsoft Distributed Transaction Coordinator can resolve this transaction. KILL command failed.
Users are connecting through MTS server. I am runnnig SQL2000 sp2 +hotfix, on NT4.0.
Has anyone encountered this problem before, and has a solution for it (besides rebooting the MTS and SQL Server)?
Every week to few weeks we'll have a situation where the cpu will max out on our main db server.
This server is a hoss, dual quad core with 16 gigs of ram. All the system type stuff looks good.
I look into the spids though and I notice a few of them that are very high in cpu.
I believe that I've noticed over time that a certain SPID never releases and starts fresh. Could it be possible that a program is written in a way that it just keeps using it over and over with each new user and it nevers releases that CPU?
I know this is a probably a pretty dumb question and there's alot of details I have to leave out for being brief. Ultimately I have to find out why the CPU is hitting 100 percent and hanging there.
I know it's this program because when I stop the app pool for only that program then the CPU on the SQL box goes back down.
Any help would be appreciated...and feel free to ask more questions for more detail and I'll try to give it.
I trying to find a way to find what the SPID of a given job that is running. I am trying to create a script that will give me the SPID the JOB_ID, and JOB_NAME. The problem comes in that if I use sysprocesses I have to pull the JOB_ID from program_name in sysprocesses and convert it into something then join it to sysjobs. Have not been sucessfull in that conversion. Any Ideas
I have a Foxpro app with a SQL Server 7 backend. The Idle Connect setting on VFP is set to indefinite. I'm having some connectivity issues where the SPID for the client seems to disappear from the active SQL processes on the server when the client sits idle for a while (10 minutes or so). On some workstations, resuming activity at the client results in the SPIDs reappearing as if they were always there with no problem. On others, the connection is not reestablished and the client gives a 1526 (VFP ODBC) error.
Does anybody know why this might be? Are the SPID connections cached at both sides and if so, how?
I've got a third party app running atop my sql server instance. When auditing logons in profiler, I see that the user (sa) logs off, and then immediately logs back on. Interestingly, the app logs back on with this user again, and the instance gives it the same spid as it previously had.
Can anyone explain this behaviour, or point me to a place where I can investigate ?
I'm wondering if it's possible to see which library which a spid is using? For example, is the spid coming from a jdbc connection, or an odbc connection?
I have a SPID 10 which running a query which is below is not getting killed and this SPID is blocking other SPID's. Is there any way to kill it pls help me
"select A.* from ARO A where A.InvoiceNumber in (select B.InvoiceNumber from AR1 B where B.Division='20' /*UNION Select C.SOApplytoInvoiceNumber from AR1 C where C.Division='20'*/ UNION Selec"
I got problems with some procedure whic are blocking one of my databases. Biggest problem is I don't which those procedures are.
Last time it happened I ran sp_who2 active. I was able to identify two suspended blocked processes, one (UPDATE - SPID:58) blocked by the other one (SELECT - SPID: 68), the other one blocked by a runnable one (UNKNOWN TOKEN - SPID: 70). For all of them I got SQLAgent - TSQL JobStep (Job [0xDA9A9D92A78C0E42A37EE96C7BEBB073] : Step [1]) so it's pretty obvious they are executed by SQL Agent Jobs.
I am trying now to identify the jobs from the keys 0xDA9A9D92A78C0E42A37EE96C7BEBB073 but no idea how to do it. I was looking at the SPIDs but I discovered they can change, so no use in that.
Hello 2 all,Maybe my question can be very stupid, but I'm a little confused.When I run sp_who on my database, I see one process (accessing remotelymy database from another database on another SQL server) many manytimes.Well, I assume that this is one process, because I cannot imagin thatthe data aquiring can be done by almost 1000 (thousand) openedconnections.This is what I have. Almost 1000 spids running (sleeping) with cmd =awaiting command.The best part is, that when I run sp_lock, I see, that the currentsession of the client, (lets say spid 53) is locking tempdb, withobjects id below 10 (system).As far as i know, and as far as I'm using this in my software, there isno necessity to open-close-open-close connection.Normaly, you can just open a connection to db, with assigned spid, andoperate within this just one. After the disconect ist done, the sessionshoould be removed.I think, there is something wrong in the way, the remote system isconnecting to my database, but i'm not sure is it normal what I'mexpieriencing or not.below, a piece of that what sp_who returned:SPIDECIDstatusloginnamehostnameblkdbnamecmd2660sleeping remote_user_namehost_ERP 0PRIMARY_PROCESS_DBAWAITING COMMAND2670sleeping remote_user_namehost_ERP 0PRIMARY_PROCESS_DBAWAITING COMMAND2680sleeping remote_user_namehost_ERP 0PRIMARY_PROCESS_DBAWAITING COMMAND2690sleeping remote_user_namehost_ERP 0PRIMARY_PROCESS_DBAWAITING COMMAND2700sleeping remote_user_namehost_ERP 0PRIMARY_PROCESS_DBAWAITING COMMAND2710sleeping remote_user_namehost_ERP 0PRIMARY_PROCESS_DBAWAITING COMMANDand these are locks from sp_lock 53 which is the current runningprocess:53700DB SGRANT53260TAB IXGRANT53210TAB IXGRANT53230TAB IXGRANT53220TAB IXGRANT532120TAB IXGRANT53290TAB IXGRANT532110TAB IXGRANT53232KEY(1902141b21c7) XGRANT53213KEY(e60041ad2c6f) XGRANT53232KEY(5b0233670fb9) XGRANT53232KEY(6e0212a7298c) XGRANT53232KEY(97013ece81c8) XGRANT53231KEY(e7006f987fb0) XGRANT53213KEY(ad00a33f46b9) XGRANT53210643560700TAB Sch-MGRANTany idee?ThanksMateusz
I'm profiling some SQL work from ADO.NET and I see a large number of sp_reset_connection but what I don't understand is how the SPID remains constant if the connection truly has been reset. Obviously it doesn't reset the SPID so what *is* going on? NB This is a number of ADO calls inside a System.Transaction.
On one of my SQL servers (SQL 2000 SP4) i have a problem with spid blocked by itself (spid 54 (Blocked by 54)).
On the server it's running a verry simple UPDATE statement (from the Query Analizer)'. The query needs very long time to finalize (on SP3 it was very fast). I searched some forums regarding this issue and i found that maybe the SP4 can cause this problem.
Having recently installed sp1 we are now getting the following intermittant error, apparantly randomly, has anyone else experienced this ... ? At present we are working around by restarting the server.
"Found active sdes for spid xx tabid xxxxxxxxxx in clean_process"
Hi, I hava a JAVA application that updates a SQL2000 (SP3a)database. The application handles different types of "jobs" which effectively update the DB.
One job in particular appears to block all subsequent jobs. It comprises of a large amount of inserts/updates in a single transaction. This is necessary as it is an "all or nothing" scenario - so we cannot break the transaction into smaller ones. The transaction appears to succeed as it reaches the COMMIT TRAN statement without error. However the records do not get written to the database. EM indicates a large number of locks held on the tables accessed by the transaction and these do not get released.
Using the SP sp_blocker_pss80, the blocking SPID has a waittime of 0 and a waittype of 0x0000 - the lastwaittype is WRITELOG and its status is AWAITING COMMAND
I am using MS SQLSERVER JDBC Driver SP2 (considering using jTDS)
I have tried - increasing Transaction Log size - Moving Transaction Log to a separate Disk - Reducing Isolation Mode to Read Uncommitted - Set AutoCOMMIT to true - set Close Cursor on COMMIT - set SelectMethod to Direct - (we use Cursor by default)
None of these have succeeded in fixing the issue.
The job will succeed if it is the first/only job to access the database. But if another job precedes it - then the blocking occurs. I have verified that the preceding job only holds shared dataabase locks before the blocking job is run.
Each job will use its own JDBC connections to access the database for reading purposes, but all of the writing goes through the blocking SPID.