deadlock

Occasional Deadlock.

I'm having trouble with a web application that will deadlock occasionally There are 3 queries involved. 2 are trying to update a table UPDATE AttendanceRoll SET ErrorFlag = 0 WHERE ContractID = @ContractID AND DATEPART(month,AttendanceDate) = DATEPART(month,@Month_Beginning) AND DATEPART(year,AttendanceDate) = DATEPART(year,@Month_Begi...

deadlock on synchronized ( String intern())

I user sun jdk 1.5 ThreadPoolExecutor( 24, 24,60,TimeUnit.SECONDS, new LinkedBlockingQueue()). soemtime I use jdb tool to find the status of all threads in thread pool are " waiting in a monitor", the code is : String key = getKey(dt.getPrefix(), id); synchronized (key.intern()) { -----> Is there a problem in "synchronized (...

Sql Server Deadlock Object IDs are too large

Hi, I am trying to trace a deadlock that is occurring in our SQL 2005 database (64-bit). We do not currently have snapshot isolation enabled. I turned on tf-1204 and received the output below. From this output I am able to determine that Node 1 is a stored procedure that selects data and only modifies values in #temp tables. Node 2...

ThreadPool and GUI wait question

I am new to threads and in need of help. I have a data entry app that takes an exorbitant amount of time to insert a new record(i.e 50-75 seconds). So my solution was to send an insert statement out via a ThreadPool and allow the user to begin entering the data for the record while that insert which returns a new record ID while that i...

Re-entrant locks in C#

Will the following code result in a deadlock using C# on .NET? class MyClass { private object lockObj = new object(); public void Foo() { lock(lockObj){ Bar(); } } public void Bar() { lock(lockObj){ // Do something } } } ...

com.ibm.websphere.jtaextensions.NotSupportedException thrown under load

Hi All, I have an application containing 4 MDB's each of which receives SOAP messages over JMS from MQ. Once the messages have been received we process the XML into an object model and process accordingly which always involves either loading or saving messages to an Oracle database via Hibernate. Additionally we have a quartz process w...

How to determine SQL that corresponds to SQL Server's sp_unprepare call?

This is probably quite basic, so bear with me (on the other hand there's probably a nice shiny cut-and-dried answer!). I'm diagnosing a deadlocking problem at the moment, and indeed I can see that one of my sessions is being blocked by another. (The other end of the deadlock are Java threads waiting on each other in the opposite order....

How to prevent deadlocks in the following C# code?

The following C# class is used in a multithreaded enviroment. I removed very much of the actual code. The problem occurs when calling MethodA and MethodB almost simultaneously. The order of the lock in the IsDepleted property doesn't solves the problem. Removing lock(WaitingQueue) from the IsDepleted property solves the deadlock, but thi...

SQL Server 2005: Key-Range Locks in Read Committed Transaction Isolation Level?

I'm helping troubleshoot some deadlocking in a .NET application that uses SQL Server 2005. I have the XML data from the trace below. What really puzzles me is the RangeX-X lock on PK_Exp_Experience_PriorFirm when the transaction isolation level is read committed. Everything I've read indicates that you only get a key-range lock of you ...

SQL Server 2005: Transaction Deadlock

Hi ppl, I am getting this error very frequently but not consistently on 2 pages in an application which is in a production environment. I just have some screen shots of the error below. Transaction(Process ID XX) was deadlocked on lock | communication buffer resources with another process and has been chosen as a deadlock victim. Reru...

Can the server use the same socket to send the response to the client? how?

I am using Berkeley sockets (both: Internet domain and Unix domain) and I was wondering if the server can use the same sockets for reading the request and writing a response to the client. Or should the client create an other socket to wait for the replay and the server connect to it after processing the message received. By the way, I ...

How do I find the handle owner from a hang dump using windbg?

How do I find out which thread is the owner of my Event handle in windbg: I'm running !handle 00003aec f and get Handle 00003aec Type Event Attributes 0 GrantedAccess 0x1f0003: Delete,ReadControl,WriteDac,WriteOwner,Synch QueryState,ModifyState HandleCount 2 PointerCount 4 Name <none> ...

Testing for a deadlock with nUnit

Hello - I'm new to unit testing and nUnit (2.48). I'd like to write a test method where the failure case is that it deadlocks. Is this possible? Obviously nUnit doesn't know by default how long the method should take to execute, so would I have to write code to do the work on a separate thread and then abort it and throw and exception if...

WinDbg -- TraceListener and Saturated ThreadPool

I have a multithreaded .NET Windows Service that hangs intermittently -- maybe once every two weeks of 24/7 operation. When the hangs occurs the threadpool is completely saturated because calls to our custom tracelistener start blocking for some reason. There aren't any locks in the offending code nor anything blocking according to windb...

What is the best way to refresh a rollup table under load?

I created a table in my SQL Server 2005 database and populated it with summary and calculated values. The purpose is to avoid extensive joins and groupings on every call to the database. I would like this table to refresh every hour, but I am not sure the best way to do this while the website is under load. If I delete every record an...

Sql 2005 Locking for OLTP - Committed or Uncommitted?

A DBA that my company hired to troubleshoot deadlock issues just told me that our OLTP databases locking problems will improve if we set the transaction level to READ COMMITTED from READ UNCOMMITTED. Isn't that just 100% false? READ COMMITTED will cause more locks, correct? More Details: Our data is very "siloed" and user specific....

Detecting deadlocks in a C# application

I am debugging an application that I suspect is getting deadlocked and hanging. However, this only occurs every few days, and it never happens on my computer so I can't hook a debugger up to it. Are there any utilities or methods I can use to query the running application and find out what methods/locks/whatever it is deadlocked on? Upd...

Database Deadlocks when using Rownum?

If I have the following code being called from multiple threads in an application, is there a deadlock risk? The transaction used to connect to the database for this is opened just before this call and closed once it returns. Application : Java Database: Oracle FUNCTION reserveWork(in_batch_id NUMBER, in_work_s...

Thread progress to GUI

I implemented threading in my application for scraping websites. After all the sites are scrapped I want to process them. form creates queueworker(which creates 2 workers and processes tasks). After all the tasks are done I want to process them baack in the formthread. At this point I accieved this with public void WaitForCompletion() ...

How to debug deadlock with python?

I am developing a multi-threading application, which is deadlocking. I am using Visual C++ Express 2008 to trace the program. Once the deadlock occurs, I just pause the program and trace. I found that when deadlock occurs, there will be two threads called python from my C++ extension. All of them use Queue in python code, so I guess ...