Community
Participate
Working Groups
Build Identifier: 20110615-0604 (created after Eclipse forum reply from Martin Taal, see http://www.eclipse.org/forums/index.php/t/222593/) Hi, I am using Eclipse 3.7, CDO 4.0 together with Hibernate, Teneo and MySQL 5.5.14 to persist some EMF objects to a MySQL database. When starting the CDO Server on an empty database, the default CDO tables and columns (as specified by org.eclipse.emf.cdo.server.hibernate in resource.hbm.xml) are created by Hibernate. In that process, I get the following error: 1860 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful: create table cdo_lob (id varchar(255) not null, clob longtext, blob longblob, size integer, primary key (id)) ENGINE=InnoDB 1860 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blob longblob, size integer, primary key (id) ) ENGINE=InnoD' at line 4 "blob" is a reserved keyword in MySQL and therefore it is not possible to create a DB column with that name. The table column name is specified by org.eclipse.emf.cdo.server.hibernate in resource.hbm.xml: <class name="org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreLob" table="cdo_lob" lazy="false"> <id name="id"/> <property name="clob"/> <property name="blob"/> <property name="size"/> </class> It seems that adding <column name="something"/> to the "blob" property would solve the problem for MySQL. Thanks! Reproducible: Always Steps to Reproduce: 1.create an empty MySQL 5.5 database 2.configure CDO 4.0 server and Hibernate to use that database 3.start the server
Fix committed to svn, but need to check how to backport to 4.1.
Hello, run into same problem with Oracle. I got: INFO o.h.tool.hbm2ddl.DatabaseMetadata - table not found: cdo_lob DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Setting dialect [org.hibernate.dialect.Oracle10gDialect] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Setting dialect [org.hibernate.dialect.Oracle10gDialect] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Setting dialect [org.hibernate.dialect.Oracle10gDialect] DEBUG o.h.tool.hbm2ddl.SchemaUpdate - create table "ANNOTATION_CONTENTS" ("ANNOTATION_E_ID" number(19,0) not null, "CONTENTS_TYPE" varchar2(255 char), "CONTENTS_ID" number(19,0), "ANNOTATION_CONTENTS_IDX" number(10,0) not null, primary key ("ANNOTATION_E_ID", "ANNOTATION_CONTENTS_IDX")) DEBUG o.h.tool.hbm2ddl.SchemaUpdate - create table "ANNOTATION_REFERENCES" ("ANNOTATION_E_ID" number(19,0) not null, "REFERENCES_TYPE" varchar2(255 char), "REFERENCES_ID" number(19,0), "ANNOTATION_REFERENCES_IDX" number(10,0) not null, primary key ("ANNOTATION_E_ID", "ANNOTATION_REFERENCES_IDX")) DEBUG o.h.tool.hbm2ddl.SchemaUpdate - create table "MODELELEMENT_details" ("ANNOTATION_DETAILS_E_ID" number(19,0), elt varchar2(255 char), "ANNOTATION_DETAILS_IDX" number(10,0) not null, primary key ("ANNOTATION_DETAILS_E_ID", "ANNOTATION_DETAILS_IDX")) DEBUG o.h.tool.hbm2ddl.SchemaUpdate - create table "MODELELEMENT" (idcol number(19,0) not null, DTYPE varchar2(255 char) not null, resource_id varchar2(255 char), container_id varchar2(255 char), version number(10,0), "SOURCE" varchar2(255 char), "ANNOTATION_MODELELEMENT_E_ID" number(19,0), "MODELELEMENT_ANNOTATIONS_IDX" number(10,0), primary key (idcol)) DEBUG o.h.tool.hbm2ddl.SchemaUpdate - create table cdo_lob (id varchar2(255 char) not null, clob clob, blob blob, size number(10,0), primary key (id)) ERROR o.h.tool.hbm2ddl.SchemaUpdate - Unsuccessful: create table cdo_lob (id varchar2(255 char) not null, clob clob, blob blob, size number(10,0), primary key (id)) ERROR o.h.tool.hbm2ddl.SchemaUpdate - ORA-00904: : invalid identifier Not sure if your fix solve the problem in generic way or only MySQL. Ales
Pushed a solution to the git repository, will be in the next build.
Hello Martin, just FYI: in Oracle the problem is caused by the "size" column, not the "blob" column... Ales
Thanks for letting me know, I have changed the name of the size column, this has been pushed to the git repository for the 4.1 build.
Closing.
Mass update. Don't worry if this bug is already closed!