![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I have a multi-threaded application that has two threads for database operations. One thread adds records to the tables of the database. Another thread is responsible for deleting old records from the database. There appear to be some issues that I need to understand to make this work better. I have sets of tables that have the following relationships: 1) Main table - EventTable ID - Identity 2) Support tables - DataTable ... ImageTable ID - Identity ... ID - Identity 3) Relationship from EventTable to support tables - EventDataTable ... EventImageTable EventID EventID DataID ImageID The add operation order is add EventTable row, add support table(s) row (i.e., DataTable), and then add relationship table row (i.e., EventDataTable). The delete operation is to allow the cascading delete via delete on the support table (i.e., DataTable) row and then delete the EventTable row. Some issues that I've encountered: 1) The delete on the support tables always raise the lock on the Table to exclusive. Does a delete operation always raise the lock level to a table lock or can I change something to only have a record or page lock on the delete operation. 2) The delete on one particular support table is much long then the other support tables. What should I look for as to the reason for this slow delete behavior. I appreciate any help you can offer to get me going understanding the issues here. |
#3
| |||
| |||
|
|
1) The delete on the support tables always raise the lock on the Table to exclusive. Does a delete operation always raise the lock level to a table lock or can I change something to only have a record or page lock on the delete operation. |
|
2) The delete on one particular support table is much long then the other support tables. What should I look for as to the reason for this slow delete behavior. |
![]() |
| Thread Tools | |
| Display Modes | |
| |