Deadlock help!

01/10/2016 21:52 zedei26#1
i got this error in my server side any one can help me how to fix this i search on google but i see the sir pumaa post but its deadlink

01/12/2016 12:52 NickHough#2
Deadlocks occur when a process runs the same sql query or procedure but does it in different orders, this is common with Flyff servers as there are functions that use these procedures in different orders with different variables.

You will have to look over the source code for these or possibly even the database procedures to see if you can re-arrange it slightly to always run in the same order calling the information in the same order
01/13/2016 06:03 xTwiLightx#3
Quote:
Originally Posted by NickHough View Post
Deadlocks occur when a process runs the same sql query or procedure but does it in different orders, this is common with Flyff servers as there are functions that use these procedures in different orders with different variables.

You will have to look over the source code for these or possibly even the database procedures to see if you can re-arrange it slightly to always run in the same order calling the information in the same order
Bullshit.

Deadlocks occur when queries like selections or even updates take too much time on one resource (which are mostly tables).
If another process tries to do a query on the same object and another isn't finished, we call it a deadlock.


How to prevent it? Proper indexing:
Code:
USE [CHARACTER_01_DBF]
GO


CREATE CLUSTERED INDEX [IDX_tblPocket_idPlayer] ON [dbo].[tblPocket]
(
	[idPlayer] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 85)
GO


CREATE NONCLUSTERED INDEX [IDX_tblPocket_idPlayer_nPocket] ON [dbo].[tblPocket]
(
	[idPlayer] ASC,
	[nPocket] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 85)
GO


CREATE CLUSTERED INDEX [IDX_tblPocketExt_idPlayer] ON [dbo].[tblPocketExt]
(
	[idPlayer] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO




CREATE NONCLUSTERED INDEX [IDX_tblPocketExt_idPlayer_nPocket] ON [dbo].[tblPocketExt]
(
	[idPlayer] ASC,
	[nPocket] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO