If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > ERROR 1223: Can't execute the query because you have a conflicting read lock

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-03-07, 09:15
Dareet Dareet is offline
Registered User
 
Join Date: Apr 2007
Posts: 6
Question 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.
Reply With Quote
  #2 (permalink)  
Old 04-03-07, 09:30
aschk aschk is offline
Registered User
 
Join Date: Mar 2007
Location: 636f6d7075746572
Posts: 770
Reply With Quote
  #3 (permalink)  
Old 04-03-07, 09:35
aschk aschk is offline
Registered User
 
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...
Reply With Quote
  #4 (permalink)  
Old 04-03-07, 09:37
aschk aschk is offline
Registered User
 
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?)
Reply With Quote
  #5 (permalink)  
Old 04-03-07, 09:52
Dareet Dareet is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On