deadlock

UPDATE heap table - Deadlock on RID

大憨熊 提交于 2020-01-03 21:03:10
问题 I'm setting up a test case to prove a certain deadlock scenario and require some insight on what is going on. I have a heap table, conventiently called HeapTable. This table is updated by 2 transactions simulateously. Transaction 1: BEGIN TRAN UPDATE HeapTable SET FirstName = 'Dylan' WHERE FirstName = 'Ovidiu'; WAITFOR DELAY '00:00:15'; UPDATE HeapTable SET FirstName = 'Bob' WHERE FirstName = 'Thierry'; ROLLBACK TRANSACTION Transaction 2: BEGIN TRAN UPDATE HeapTable SET FirstName = 'Pierre'

std::lock still caused deadlock

醉酒当歌 提交于 2020-01-03 14:30:05
问题 std::lock is used to prevent deadlock, right? However in my testing, it still caused deadlock. Could you check my test code to see if I used it incorrectly? std::mutex m1; std::mutex m2; void func1() { std::unique_lock<std::mutex> lock1(m1, std::defer_lock); printf("func1 lock m1\n"); std::this_thread::sleep_for(std::chrono::seconds(2)); std::unique_lock<std::mutex> lock2(m2, std::defer_lock); printf("func1 lock m2\n"); std::lock(m1, m2); printf("func1 std lock\n"); } void func2() { std:

python subprocess deadlock in demonized server

巧了我就是萌 提交于 2020-01-02 21:55:26
问题 I'm trying to set up a remote backup server for dar, along these lines. I'd really like to do all the piping with python if possible, but I've asked a separate question about that. Using netcat in subprocess.Popen(cmd, shell=True) , I succeeded in making a differential backup, as in the examples on the dar site. The only two problems are: I don't know how to assign port numbers dynamically this way If I execute the server in the background, it fails. Why? Update: This doesn't seem to be

Troubleshooting a COM+ application deadlock

≡放荡痞女 提交于 2020-01-02 07:30:26
问题 I'm trying to troubleshoot a COM+ application that deadlocks intermittently. The last time it locked up, I was able to take a usermode dump of the dllhost process and analyze it using WinDbg. After inspecting all the threads and locks, it all boils down to a critical section owned by this thread: ChildEBP RetAddr Args to Child 0deefd00 7c822114 77e6bb08 000004d4 00000000 ntdll!KiFastSystemCallRet 0deefd04 77e6bb08 000004d4 00000000 0deefd48 ntdll!ZwWaitForSingleObject+0xc 0deefd74 77e6ba72

Java deadlock problem

你离开我真会死。 提交于 2020-01-02 07:28:11
问题 I am using java sockets for communication. On the client side I have some processing and at this point I send an object to the cient. The code is as follows: while (true) { try { Socket server = new Socket("localhost", 3000); OutputStream os = server.getOutputStream(); InputStream is = server.getInputStream(); CommMessage commMessage = new CommMessageImpl(); ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(bos); oos.writeObject

Deadlock issue in SQL Server 2008 R2 (.Net 2.0 Application)

 ̄綄美尐妖づ 提交于 2020-01-02 02:53:30
问题 The Sql Server 2008 R2 instance in question is a heavy load OLTP production server. The deadlock issue came up a few days back and is still unresolved. We received the Xml deadlock report that listed the stored procedures involved in the deadlock and some other details. I'll try to list down the facts from this xml first: Two stored procedures are involved in the deadlock, say SP1 and SP2. According to the report SP1 was running in Isolation level "Serializable" and SP2 was running in

Is it possible to create a deadlock with read-only access?

£可爱£侵袭症+ 提交于 2020-01-02 02:11:06
问题 I have a VB6 application accessing a single table on a MSSQL2000 server via ADO. I'm using read-only access (adOpenStatic, adLockReadOnly) There are other applications in the network which do make changes to the table. For some reason I'm getting errors about my application being chosen as a deadlock victim. I'm really confused: Why can there be a deadlock when I'm just reading from a single table? I'd expect timeouts, because of the writing of the other applications, but not a deadlock...

Can a readcommitted isolation level ever result in a deadlock (Sql Server)?

為{幸葍}努か 提交于 2020-01-01 08:47:28
问题 My understanding of deadlocks is - two processes trying to contend for same resource - typically two processes trying to 'write' to same row of data. If all one process is doing is reading the data - and the other process is updating the data, how is that a resource contention? Yet, in our database, which is set to the default transaction level 'ReadCommitted', we are seeing several deadlock exceptions. ReadComitted definitin - Data that has been modified (but not yet committed) cannot be

SQL Server 2005 deadlock with nonclustered index

孤街醉人 提交于 2020-01-01 08:40:13
问题 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 lock) with X lock. The second session keeps row U lock and key U lock. The deadlock picture shows "//step2" of first session requires key U lock. If the index is

MySQL deadlocks with stored procedure generating UID

六眼飞鱼酱① 提交于 2020-01-01 05:23:13
问题 I have a stored procedure generating UID's from a "ticket" table, but under load I'm getting lots of deadlocks. I'm calling this procedure many times from multiple concurrent connections whenever my task needs a new UID. BEGIN DECLARE a_uid BIGINT(20) UNSIGNED; START TRANSACTION; SELECT uid INTO a_uid FROM uid_data FOR UPDATE; # Lock INSERT INTO uid_data (stub) VALUES ('a') ON DUPLICATE KEY UPDATE uid=uid+1; SELECT a_uid+1 AS `uid`; COMMIT; END I did consider using: BEGIN REPLACE INTO uid