Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2007
    Posts
    6

    Question Unanswered: ERROR 1223: Can't execute the query because you have a conflicting read lock

    Hi guys,
    I'm currently working on a JDBC project, I have one page which has a SELECT * FROM table to retrieve column headers - This is a JDBC transaction

    But my next page contains an insert - However when I try to insert into the table I get: ERROR 1223: Can't execute the query because you have a conflicting read lock

    I have tried "UNLOCK TABLES" and I have set permissions with the user as Select in the User table, and everything except GRANT in the db table.

    I'm using version 4.024, and I have a dev machine which is the same, however the dev machine works fine, but my other machine just throws this error at me!

    I have tried the insert at command line with the same user and I get the same error.

    Does anyone have any ideas what could be causing this? And How to solve the problem?
    Thanks and best regards
    Dareet.

  2. #2
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770

  3. #3
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    What you have done is start a transaction, done a READ LOCK select on a table, and then tried to insert into when its locked in the same transaction. Use seperate transactions...

  4. #4
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    You may find your production server has a different MySQL setup with read locks set on by default (if that is possible?)

  5. #5
    Join Date
    Apr 2007
    Posts
    6
    Thanks guys but the problem was my mistake - It was a snapshot server which I have put into read-only mode in the "my.cnf"
    Sorted it now - Thanks anyway guys
    Best regards
    Dareet

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •