From graffito-dev-return-280-apmail-incubator-graffito-dev-archive=www.apache.org@incubator.apache.org Wed Jun 08 16:08:07 2005 Return-Path: Delivered-To: apmail-incubator-graffito-dev-archive@www.apache.org Received: (qmail 90609 invoked from network); 8 Jun 2005 16:08:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Jun 2005 16:08:06 -0000 Received: (qmail 31270 invoked by uid 500); 8 Jun 2005 16:08:05 -0000 Mailing-List: contact graffito-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: graffito-dev@incubator.apache.org Delivered-To: mailing list graffito-dev@incubator.apache.org Received: (qmail 31257 invoked by uid 99); 8 Jun 2005 16:08:05 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=UPPERCASE_25_50 X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from smtp.fusemail.net (HELO fuse1.fusemail.net) (69.31.1.141) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 08 Jun 2005 09:08:04 -0700 Received: from fusemail.com by fuse1.fusemail.net with asmtp (TLSv1:AES256-SHA:256) (FuseMail extSMTP) id 1Dg35f-0008G6-AK for graffito-dev@incubator.apache.org; Wed, 08 Jun 2005 11:07:39 -0500 Message-ID: <42A717CB.20901@maisey.co.uk> Date: Wed, 08 Jun 2005 17:07:39 +0100 From: Martin Maisey User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: graffito-dev@incubator.apache.org Subject: MySQL/InnoDB build issues Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi all, I'm trying to get up and running with Graffito, and having a few build issues I was hoping someone could help me with... To save some other people some time, some history: Firstly, I tried HSQLDB and hit the same problems as Herman did - unfortunately, I only just saw his posting last Saturday and the reply. I then tried MySQL (v4.0.24). I hit an issue with the TestSpringEngine.testGraffitoEngine() unit test failing at the assert on line 126. Had a quick look at the code - appeared to be that the rollback wasn't working. Checked the MySQL table type and it was MyISAM, so non-transactional - I assume this test needs transactional capability on the database. Is this correct? Trying again with InnoDB as the default table type, I get a failure earlier in the build during the database creation stage: --- db.create: db.execute: [sql] Executing file: C:\cygwin\home\martin.maisey\graffito\components\targe t\src\sql\mysql\security-schema.sql [sql] [ERROR] Failed to execute: CREATE TABLE PRINCIPAL_PERMISSION ( PRINCIP AL_ID INTEGER NOT NULL, PERMISSION_ID INTEGER NOT NULL, PRIMARY KEY(PRINCIPAL_ID ,PERMISSION_ID), FOREIGN KEY (PERMISSION_ID) REFERENCES SECURITY_PERMISSION (PER MISSION_ID) , FOREIGN KEY (PRINCIPAL_ID) REFERENCES SECURITY_PRINCIPAL (PRINCIPA L_ID) ) BUILD FAILED File...... C:\cygwin\home\martin.maisey\graffito\maven.xml Element... maven:reactor Line...... 77 Column.... 40 Unable to obtain goal [test:test] -- C:\cygwin\home\martin.maisey\graffito\compo nents\maven.xml:97:33: java.sql.SQLException: Can't create table '.\graffi to\principal_permission.frm' (errno: 150) --- It looks to me like the problem is that the Torque-generated SQL in components/target/src/sql/mysql/security-schema.sql isn't generating enough indexes for the foreign keys to work - it generates (clean version of the above): --- DROP TABLE PRINCIPAL_PERMISSION; CREATE TABLE PRINCIPAL_PERMISSION ( PRINCIPAL_ID INTEGER NOT NULL, PERMISSION_ID INTEGER NOT NULL, PRIMARY KEY(PRINCIPAL_ID,PERMISSION_ID), FOREIGN KEY (PERMISSION_ID) REFERENCES SECURITY_PERMISSION (PERMISSION_ID) , FOREIGN KEY (PRINCIPAL_ID) REFERENCES SECURITY_PRINCIPAL (PRINCIPAL_ID) ); --- but the PERMISSION_ID foreign key declaration fails as there isn't an index with PRINCIPAL_ID as the first component, which MySQL requires. The following SQL works: --- DROP TABLE PRINCIPAL_PERMISSION; CREATE TABLE PRINCIPAL_PERMISSION ( PRINCIPAL_ID INTEGER NOT NULL, PERMISSION_ID INTEGER NOT NULL, INDEX (PERMISSION_ID), PRIMARY KEY(PRINCIPAL_ID,PERMISSION_ID), FOREIGN KEY (PERMISSION_ID) REFERENCES SECURITY_PERMISSION (PERMISSION_ID) , FOREIGN KEY (PRINCIPAL_ID) REFERENCES SECURITY_PRINCIPAL (PRINCIPAL_ID) ); --- It's possible to get around this by changing components/src/schema/security-schema.xml's definition of PRINCIPAL_PERMISSION to --- new--> new--> new-->
--- But then I run straight into a similar problem with SECURITY_CREDENTIAL. So my question is - the response to Herman's posting suggested MySQL, but what version/configuration of MySQL is a good one for Graffito? Cheers, Martin