deadlock

Thread deadlock blocked on Hibernate transaction

I have one process which creates a database entity and then launches a second process. It then waits on the second process to find and update the database entity before completing its processing, and thereby committing the database entity. The trouble seems to be that since the initial process which performed the entity creation has no...

C#: Invoke Event from Locked Block

I have usually heard that it is a good idea to unlock any locks before calling event listeners to avoid deadlock. However, since the lock {} block is reentrant by the same thread in C#, is it OK to call events from a locked block or do I need to make a copy of the relevant state data and invoke the event outside the lock block? If not,...

detecting/preventing error/deadlock when opening/reading text file

I am reading file with text contents on it. sample dictionary.txt contents: aa abaca abroad apple Snippet A: Dim path as String = Server.MapPath("dictionary.txt"); Dim dictionary() as String = {} Try { dictionary = File.ReadAllLines(path) } Catch ex as Exception End Try Snippet B: Dim path as String = Server.Ma...

Would you explain lock ordering?

I learned that I should unlock reverse order to lock order. For example. A.lock(); B.lock(); B.unlock(); A.unlock(); But, what happen if I did like this : A.lock(); B.lock(); A.unlock(); B.unlock(); I try to make a deadlock scenario, but if I always lock A earlier then B, then I don't know how deadlock would happen. Would you help me?...

SQL Server Profiler: How can I display query parameter values in deadlock graph?

Hi, I'm trying to debug a deadlock with SQL Server Profiler 2008. I know how to get a graph of the deadlock in the profiler, but when I hover over one of the two statements in shown in the graph, the "Statement" tooltip that appears only contains the query with parameter names, not values. In other words I get tooltips like this: DE...

Deadlock, some questions...

After some phase of testing of my task scheduler I encountered a deadlock pretty much random. I want to ask some help, especially I want to know if my approach can take to a deadlock or if the problem is elsewhere. Before starting i'll say that the application is a fullscreen game. (in case it may influence anything) I'll explain in wor...

a method with breakpoint is called in WCF service before execution

hi all, I have a strange situation in my application. I have a service that needs to return some value from the DB. My service calls to some method in a singleton (by using the GetInstance method). For the purpose of debugging i wrote logging messages in every method along with a view of the call stack. While debugging i noticed somet...

Can I be a deadlock victim if I'm not executing a query within a transaction?

Lets say I open a transaction and run update queries. BEGIN TRANSACTION UPDATE x SET y = z WHERE w = v The query returns successfully and the transaction stays open deliberately for a period of time before I decide to commit. While I'm sitting on the transaction is it ever possible the MSSQL deadlock machinary would be able to preemp...

Examining KEYLOCKs in SQL Server 2005

I've been trying to solve various deadlocks we are seeing in production. We've enabled deadlock tracing. The traces show lots of blocking on KEYLOCKs like this: 01/15/2010 08:25:07,spid15s,Unknown,keylock hobtid=72057594047758336 dbid=2 objectname=tempdb.dbo.MyTable indexname=IX_MyTable id=lock36977900 mode=X associatedObjectId=720575...

Regarding SQL Server Locking Mechanism

Dear GURUs I would like to ask couple of questions regarding SQL Server Locking mechanism If i am not using the lock hint with SQL Statement, SQL Server uses PAGELOCK hint by default. am I right??? If yes then why? may be its due to the factor of managing too many locks this is the only thing i took as drawback but please let me know ...

SQL Server 2005 deadlock with nonclustered index

Hello, Can anybody help me for a deadlock in SQL Server 2005? For a simple test, I have a table "Book" which has a primary key (id), and a column name. The default index of this primary key is nonclustered. The deadlock happens when two sessions run at a same time. Activity monitor shows the first session "//step 1" locks the row(rid...

Applet getting Hang

I found following post http://stackoverflow.com/questions/370710/java-6-jvm-hang with somewhat similar exception that am getting. There is no deadlock. But many threads are in WAIT state. Stack trace is as follows. My Client JRE is 1.6.0_18. "Applet 1 LiveConnect Worker Thread" prio=4 tid=0x03382800 nid=0xe40 in Object.wait() [0x03acf00...

Where can I find deadlock log information

Where can I find documentation that explains all the cryptic information returned in the SQL Server logs when a deadlock occurs? I've read several articles that describe some of the items, but I'm trying to find the definitive docs understanding deadlock-list log information and how to use the information when diagnosing the problem. Fo...

Mysql transaction waiting for lock which is already granted .. This is causing deadlock

If following situation a bug in mysql?. Mysql Version: mysql.x86_64 5.0.77-4.el5_4.1 Kernel: Linux box2 2.6.18-128.el5 #1 SMP Wed Jan 21 10:41:14 EST 2009 x86_64 x86_64 x86_64 GNU/Linux LATEST DETECTED DEADLOCK 100125 4:24:41 * (1) TRANSACTION: TRANSACTION 0 210510625, ACTIVE 155 sec, process no 28125, OS thread id 1243162944 st...

Deadlock logs missing Node data

When capturing a deadlock event in the logs, I am getting a message that indicates: Log Viewer could not read information for this log entry. Cause: Data is Null. This method or property cannot be called on Null values.. When I look in the ERRORLOG file, I see something like this: 2010-01-18 04:47:15.69 spid4s Wait-for graph...

How to explain the "deadlock" better?

I am struggling to explain "deadlock" in threads in easy words, so please help. What could be the best example of "deadlock" (say, in Java), and how it does happen in steps and how to prevent it? But without getting into details too deep. I know that's like asking two opposite things, but still. If you have any previous concurrent progra...

Deadlock in Single threaded application.

Can a single threaded application have a deadlock? If so, please provide an example. ...

How to avoid database deadlocks

I have a clustered application that is suffering from database deadlocks. It is a j2ee application using JPA and hibernate. The database is DB2 8.1 on Z/OS is set to page locking (this is a requirement for the company). The problem is that the primary key are generated as a sequence, and will often deadlock while trying to insert reco...

Are there any static code analysis tools that look at potential execution paths that might lead to a deadlock(C#)

Is there any tool or plugin for visual studio (2008) that will go over a C# class and look for possible scenarios that could lead to potential deadlocks? Anything that would seek out every lock (xxx) {} block and then seek other methods that call the method leading to that critical section and forms a list of methods that could lead to a...

tools to detect .net application deadlock

can anybody recommend tools to detect .net application deadlock? EDIT: Chess is what i found from Microsoft. ...