Bug #65498 MySql 5.5 throws exception when Update statement does not find a record
Submitted: 3 Jun 2012 6:44 Modified: 3 Jul 2012 7:48
Reporter: Yaniv Cohen Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:5.5 OS:Linux
Assigned to: CPU Architecture:Any
Tags: innodb, update statement

[3 Jun 2012 6:44] Yaniv Cohen
Description:
I'm using MySql 5.5, queries are executing via Spring Framework(JdbcTemplate) over Jboss 5.1

I'm experiencing an issue which causes an update statement to throw the following:

javax.ejb.EJBTransactionRolledbackException: PreparedStatementCallback; uncategorized SQLException for SQL [ UPDATE events SET last_update=?  WHERE  account_id=? ]; SQL state [HY000]; error
     code [1032]; Can't find record in 'events'; nested exception is java.sql.SQLException: Can't find record in 'events
'

remark: The 'events' table has no FK. 

why do I get an exception when the record is not found(it is expected behavior) ? and how can I prevent that from happening?

is it related to the following old issue: http://bugs.mysql.com/bug.php?id=1574&thanks=3&notify=71

Many Thanks

Yaniv

How to repeat:

This randomly happens so I have no definition of how exactly to repeat it.
[3 Jun 2012 7:48] Valeriy Kravchuk
We need a repeatable test case to be able to say anything definite. Start with CREATE TABLE for the table in question. Also, are you sure that record you refer to in UPDATE really exists?
[4 Jul 2012 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".