|
hibernate.dialect org.hibernate.dialect.MySQL5InnoDBDialect Nothing other change except hibernate3.jar from version 3.2.3 to version 3.2.4 I think, that INSERT SQL query must be without row id column, because it is autoincrement. Hibernate 3.2.4 INSERT SQL: Sure, and that is based on dialect. The mysql dialects have not changed between 3.2.3 and 3.2.4. Hence why I need a test case I have not test case, but I can show same trace log of 3.2.3 version: 10.05.07 18:03:40 DEBUG [btpool0-0]: SQL - insert into PaymentDO (_version, comment, created, customer_id, nalichka, newBalance, payDate, sum) values (?, ?, ?, ?, ?, ?, ?, ?) I've the same problem with SQLServer. I presume you are talking about this code: // add the primary key Well for the base tablle (j==0) of entities with an identity PK (identityInsert==true) we call the special Insert#addIdentityColumn method. That method conditionally add the identity column to the insert based on what the dialect says... So, yes, I need a test case. Running the unit test using MySQLInnoDBDialect found 6 failures and 205 errors. There were 200 occurrences of the string "No value specified for parameter". There were 6 failures and 5 errors when running Hypersonic with 0 occurrences of the string. I believe this bug was introduced by the fix for After changing: sqlIdentityInsertString = sqlInsertStrings[0] == null to: sqlIdentityInsertString = customSQLInsert[0] == null (as suggested by Scott Rankin in I'm having the same problem with MySQL 5 and org.hibernate.dialect.MySQLDialect. All our IDs are auto-increment, and we are using generator=native. This is readily apparent when attempting to save any entity. I'm seeing this with MySQL5 and org.hibernate.dialect.MySQL5Dialect I have the same issue, my app. was working fine with 3.2.2 and 3.2.3 but fails with 3.2.4. Notice that in my case I use Informix dialect. See below the difference of the SQL (captured with the p6spy jdbc driver). In my case the field ID is an Informix serial field which gets auto-incremented by Informix: 3.2.3: 3.2.4: See the corresponding bit of mapping below: So, 3.2.4 is adding the ID column to the insert statement when it should not, on top of that it is setting its value to null, which conflicts with my table definition (as this is the PK). Same problem as Igor. I've the same problem as above, with this exception when I try to 'persist' an entity bean like the following one in a mysql database (version 5.0.38) : package quickstart.model; import javax.persistence.Entity; @Entity @Id public String getFirstName() {
return firstName;
} I use spring 2.0 and xwork 2.0.1. The save method is : I get this error : 15:39:49,381 INFO [STDOUT] Hibernate: insert into Person (firstName, lastName, id) values (?, ?, ?) I tried to manually insert via phpmyadmin the same row in the database, and notice that if the 'id' is not set (as it's setted to 'auto increment' in the table), the generated query is : INSERT INTO `Person` ( `id` , `firstName` , `lastName` ) thus, the 'id' column is well setted but to a NULL value, and it's works, the row is added. This hibernate bug is blocking for me. For what it's worth, we're seeing the same behavior in only 3.2.4 with our objects which use autogenerated keys (e.g., including the 'id' field in the insert statement). AS400Dialect. Similar problem here with DB2 and any mappings that use a "native" generator. Looking at the debug logs, I see that the "identity insert" string has changed between 3.2.3 and 3.2.4. Here's an example: 3.2.3: insert into USER_BOOKMARK_GROUP (USER_BOOKMARK_GROUP_ID, UPDATE_TIMESTAMP, CREATE_TIMESTAMP, CREATE_USER, UPDATE_USER, INACTIVE_DATE, USER_ID, GROUP_NAME, SEQUENCE_NUMBER) values (default, ?, ?, ?, ?, ?, ?, ?, ?) 3.2.4: insert into USER_BOOKMARK_GROUP (UPDATE_TIMESTAMP, CREATE_TIMESTAMP, CREATE_USER, UPDATE_USER, INACTIVE_DATE, USER_ID, GROUP_NAME, SEQUENCE_NUMBER, USER_BOOKMARK_GROUP_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?) The latter causes DB2 to throw an exception in 3.2.4. Prior versions (including 3.2.3) worked fine. Yes, actually this has been verified to be a serious bug. Unfortunately I have been traveling the past few days and have not had a chance to fix it as of yet. However, I just returned home and will have a patch release out tomorrow fixing the issue. FYI, the same code as I pasted above works well (no exceptions when call EntityManager.persist with ID primary key setted to @GeneratedValue) with the last version 3.2.3 of hibernate. Notice : I've only changed the hibernate librairies core from 3.2.4 to 3.2.3, but I still work with hibernate-annotations-3.3.0.GA and hibernate-entitymanager-3.3.1.GA. Could you please update dependencies of hibernate-entitymanager pom.xml in Maven repositories? The current version 3.3.1.GA still refers the buggy version 3.2.4 of hibernate core. Regards, Ollie The POM issue has still not been fixed, i'm seeing <dependency> in the file hibernate-entitymanager-3.3.1.ga.pom . Oliver do you know what the workaround for this is? Do I just manually edit my pom in my local repository? To answer my own question my problem was that i didn't have an explicit dependency on hibernate core, ie I was missing the first dependency listed below, which meant that hibernate core 3.2.4 was being included because it is a dependency of hibernate-entitymanager 3.3.1 <dependency> No Oliver we cannot. 1) Those are not poms developed by the Hibernate team The correct solution would be for your project to define a dep to 3.2.6 in <dependencyManagement/> |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Need a test case. Are you using a custom dialect?