|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I'm doing a single insert with a prepared query on an empty table. I have something like: - BEGIN TRANSACTION - PREPARE QUERY - EXECUTE QUERY - COMMIT TRANSACTION The first time I run it, everything is fine. The second time, though, I get a deadlock error: deadlock: violation of PRIMARY or UNIQUE KEY constraint "PK_USERS" on table "USERS" Please note that I empty the table between the two requests. The third time I run the query, it's fine again, and the fourth returns a deadlock error again, and so on. Why does that happen? TIA |
|
#2
|
||||
|
||||
|
Is that the table you are trying to insert a record into ? table USERS ?
can you post some of the query's text ? |
|
#3
|
||||
|
||||
|
sorry for the delay but I didn't get the email notice
Quote:
yes Quote:
This is a php script reproducing this issue: PHP Code:
and this is the table definition: Code:
USER_ID INTEGER Primary Key(PK_USERS) SUBSCRIBED CHARACTER(1) QUOTA DECIMAL(10) WEIGHT DOUBLE ACCESS_DATE DATE ACCESS_TIME TIME APPROVED TIMESTAMP USER_NAME VARCHAR(255) USER_PASSWORD CHARACTER(200) |
|
#4
|
|||
|
|||
|
Is your transaction commited AFTER you empty table?
-- Best regards, Fikret Hasovic http://fikret.fbtalk.net TAMP R&D Team FirebirdSQL Foundation member. - Join today at http://www.firebirdsql.org/ff/foundation JEDI VCS contributor http://jedivcs.sourceforge.net/ |
|
#5
|
|||
|
|||
|
Quote:
the 'DELETE FROM users' query is not within a transaction... |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > deadlock |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|