Hi,
I'm trying to insert and update into SQL server table through ODBC stage.
I'm getting the below error. Pls help me to resolve it.
Error 1:
ODBC_Connector_21,0: Execute failed on statement INSERT INTO
tblBloombergMonthly( ID_CUSIP , MTG_FACTOR , MTG_FACTOR_DT , MTG_EST_ACC_RT,UserID)
VALUES
(? ,? ,? ,?,?)
Error 2:
ODBC_Connector_21,0: ODBC function "SQLExecute" reported: SQLSTATE = 40001: Native Error Code = 1,205: Msg = [IBM(DataDirect OEM)][ODBC SQL Server Driver][SQL Server]Transaction (Process ID 70) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. (CC_OdbcDBStatement::executeInsert, file CC_OdbcDBStatement.cpp, line 673)
I tried re run the job and tried inserting and updating separately.But still getting the same error.
Deadlock while inserting and updating
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 75
- Joined: Mon Jul 12, 2010 4:11 am
- Location: Chennai
-
- Participant
- Posts: 75
- Joined: Mon Jul 12, 2010 4:11 am
- Location: Chennai
-
- Premium Member
- Posts: 120
- Joined: Thu Oct 28, 2004 4:24 pm
The problem is that there is no index on the where clause columns, and keep in mind the order of the columns makes a difference. By that I mean that the order of the columns in the index needs to match the order of the columns in the where clause.
What happens is that a job when trying to update will try to place a table lock if there is no index and if another process already has a row locked then it cannot get exclusive access to place the table lock.
With an index it does not use a table lock.
I have had the same problems. I had to review all the developers jobs and make sure the appropriate indexs were there.
What happens is that a job when trying to update will try to place a table lock if there is no index and if another process already has a row locked then it cannot get exclusive access to place the table lock.
With an index it does not use a table lock.
I have had the same problems. I had to review all the developers jobs and make sure the appropriate indexs were there.
"Don't let the bull between you and the fence"
Thanks
Gregg J Knight
"Never Never Never Quit"
Winston Churchill
Thanks
Gregg J Knight
"Never Never Never Quit"
Winston Churchill