Bug #4992 getGeneratedKeys returns empty RecordSet
Submitted: 11 Aug 2004 15:07 Modified: 11 Aug 2004 15:19
Reporter: Stefano Moraschini Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:3.1.3-beta OS:Windows (Windows XP, Linux Debian)
Assigned to: CPU Architecture:Any

[11 Aug 2004 15:07] Stefano Moraschini
Description:
Two servers:
1) Windows XP, MySQL server 4.0.13, Tomcat 4.1.30, 4 differents Tomcat contexts
2) Linux Debian, MySQL server 4.0.18, Tomcat 4.1.30, 4 differents Tomcat contexts

Both servers runs same data and same web applications.

I have a TABLE with the following structure:

CREATE TABLE messaggi (
  MsgID int PRIMARY KEY NOT NULL AUTO_INCREMENT,
  Status char(1),
  Mitt  varchar(175),
  Email varchar(175),
  Text  text,
  DataArc datetime,
  DataIns datetime
);

Since I used connector/J 3.1.3-beta I have a problem only in one of the 4 Tomcat contexts, running same base Java application (methods to access database are always the same in all contexts).

The problem:
running this query
INSERT INTO messaggi (Status, Mitt, Email, Text, DataArc, DataIns) VALUES (NULL, 'Test', 'myemail@mydomain.com', 'test', NULL, NOW());
getGeneratedKeys() returns an empty RecordSet

How to repeat:
Notes:
- the record has been inserted
- Original table has over 60000 records. Trying do DROP & re-CREATE TABLE there is no problem
- DELETING all records from the original table (about 60000 records), without "DROP & re-CREATE", problem remains
- trying with connector/J 3.0.14-production there is no problem
- each Tomcat context uses a different jar (web application) file, but every jar contains the same methods to access database data. The very strange thing I cannot explain is that the problem appears only in one of these contexts, which has no particular differences than the others.
[11 Aug 2004 15:18] Mark Matthews
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.mysql.com/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.
[11 Aug 2004 15:19] Mark Matthews
Are you running the query from a normal Statement, or a PreparedStatement?
[12 Aug 2004 14:04] Stefano Moraschini
PreparedStatement