Discussion:
[JIRA] Created: (MYO-107) Error on last insert id with mysql driver version >= 5.1.7
Gilles Rayrat (JIRA)
2009-08-28 20:13:46 UTC
Permalink
Error on last insert id with mysql driver version >= 5.1.7
----------------------------------------------------------

Key: MYO-107
URL: https://forge.continuent.org/jira/browse/MYO-107
Project: Tungsten Connector
Type: Bug

Components: MySQL protocol
Reporter: Gilles Rayrat
Assigned to: Gilles Rayrat
Fix For: 0.6.9


With mysql-connector-java-5.1.7 and later, the following error is raised at each query:
jvm 1 | WARN [MySQLProtocolHandler] - Can't get last insert id.
jvm 1 | java.sql.SQLException: Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement().
jvm 1 | at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
jvm 1 | at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
jvm 1 | at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
jvm 1 | at com.mysql.jdbc.StatementImpl.getGeneratedKeys(StatementImpl.java:1843)
jvm 1 | at org.continuent.myosotis.protocol.mysql.MySQLProtocolHandler.getLastInsertId(MySQLProtocolHandler.java:692)
jvm 1 | at org.continuent.myosotis.protocol.mysql.MySQLProtocolHandler.processQuery(MySQLProtocolHandler.java:394)
jvm 1 | at org.continuent.myosotis.protocol.mysql.MySQLProtocolHandler.processCommand(MySQLProtocolHandler.java:198)
jvm 1 | at org.continuent.myosotis.protocol.mysql.MySQLProtocolHandler.processClientPacket(MySQLProtocolHandler.java:154)
jvm 1 | at org.continuent.myosotis.protocol.mysql.MySQLConnectionHandler.run(MySQLConnectionHandler.java:104)
jvm 1 | at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
jvm 1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
jvm 1 | at java.lang.Thread.run(Thread.java:595)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://forge.continuent.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
Gilles Rayrat (JIRA)
2009-08-28 22:00:46 UTC
Permalink
[ https://forge.continuent.org/jira/browse/MYO-107?page=comments#action_15747 ]

Gilles Rayrat commented on MYO-107:
-----------------------------------

Mysql bug: http://bugs.mysql.com/bug.php?id=34185
Post by Gilles Rayrat (JIRA)
Error on last insert id with mysql driver version >= 5.1.7
----------------------------------------------------------
Key: MYO-107
URL: https://forge.continuent.org/jira/browse/MYO-107
Project: Tungsten Connector
Type: Bug
Components: MySQL protocol
Reporter: Gilles Rayrat
Assignee: Gilles Rayrat
Fix For: 0.6.9
jvm 1 | WARN [MySQLProtocolHandler] - Can't get last insert id.
jvm 1 | java.sql.SQLException: Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement().
jvm 1 | at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
jvm 1 | at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
jvm 1 | at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
jvm 1 | at com.mysql.jdbc.StatementImpl.getGeneratedKeys(StatementImpl.java:1843)
jvm 1 | at org.continuent.myosotis.protocol.mysql.MySQLProtocolHandler.getLastInsertId(MySQLProtocolHandler.java:692)
jvm 1 | at org.continuent.myosotis.protocol.mysql.MySQLProtocolHandler.processQuery(MySQLProtocolHandler.java:394)
jvm 1 | at org.continuent.myosotis.protocol.mysql.MySQLProtocolHandler.processCommand(MySQLProtocolHandler.java:198)
jvm 1 | at org.continuent.myosotis.protocol.mysql.MySQLProtocolHandler.processClientPacket(MySQLProtocolHandler.java:154)
jvm 1 | at org.continuent.myosotis.protocol.mysql.MySQLConnectionHandler.run(MySQLConnectionHandler.java:104)
jvm 1 | at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
jvm 1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
jvm 1 | at java.lang.Thread.run(Thread.java:595)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://forge.continuent.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
Gilles Rayrat (JIRA)
2010-02-09 11:10:46 UTC
Permalink
[ https://forge.continuent.org/jira/browse/MYO-107?page=all ]

Gilles Rayrat closed MYO-107:
-----------------------------

Resolution: Fixed

Fix commited in SVN
Post by Gilles Rayrat (JIRA)
Error on last insert id with mysql driver version >= 5.1.7
----------------------------------------------------------
Key: MYO-107
URL: https://forge.continuent.org/jira/browse/MYO-107
Project: Tungsten Connector
Type: Bug
Components: MySQL protocol
Reporter: Gilles Rayrat
Assignee: Gilles Rayrat
Fix For: 0.6.8
jvm 1 | WARN [MySQLProtocolHandler] - Can't get last insert id.
jvm 1 | java.sql.SQLException: Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement().
jvm 1 | at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
jvm 1 | at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
jvm 1 | at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
jvm 1 | at com.mysql.jdbc.StatementImpl.getGeneratedKeys(StatementImpl.java:1843)
jvm 1 | at org.continuent.myosotis.protocol.mysql.MySQLProtocolHandler.getLastInsertId(MySQLProtocolHandler.java:692)
jvm 1 | at org.continuent.myosotis.protocol.mysql.MySQLProtocolHandler.processQuery(MySQLProtocolHandler.java:394)
jvm 1 | at org.continuent.myosotis.protocol.mysql.MySQLProtocolHandler.processCommand(MySQLProtocolHandler.java:198)
jvm 1 | at org.continuent.myosotis.protocol.mysql.MySQLProtocolHandler.processClientPacket(MySQLProtocolHandler.java:154)
jvm 1 | at org.continuent.myosotis.protocol.mysql.MySQLConnectionHandler.run(MySQLConnectionHandler.java:104)
jvm 1 | at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
jvm 1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
jvm 1 | at java.lang.Thread.run(Thread.java:595)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://forge.continuent.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
Loading...