Hi,
No, it is broken JAWS table generation for all
databases that do not understand the CONSTRAINT
keyword. This includes the default Hypersonic
database. Has been so for about a week. A bit
hard to find out because the error message is
logged at debug level.
This makes the test suite fail.
Not hard to fix: Just comment out the CONSTRAINT
generation near the top of
src/main/org/jboss/ejb/plugins/jaws/jdbc/JDBCInitCommand.java.
However, I do not like to commit this to CVS
since I do not know this code, do not use it
(except when running the test suite) and there
was probably some reason for it to be added.
But I wouldn't mind if this is corrected.
If you do it, please also change log.debug(...)
in line 127 to log.error(...).
Best Regards,
Ole Husgaard.
Toby Allsopp wrote:
>
> Is it just me, or is the SQL syntax for primary keys broken? Well, I
> know it's not just me - it's at least HypersonicSQL as well.
>
> Running the testbean test gives failures creating the tables. One of the
> offending SQL strings is (formatting added by me):
>
> CREATE TABLE nextgen_EnterpriseEntity (
> name VARCHAR(256) CONSTRAINT pknextgen_EnterpriseEntity PRIMARY KEY,
> otherField INTEGER
> )
>
> I'm no SQL expert (well, I've written a parser for SELECT statements,
> but I haven't implemented CREATE TABLE yet :-), but shouldn't this be:
>
> CREATE TABLE nextgen_EnterpriseEntity (
> name VARCHAR(256),
> otherField INTEGER,
> CONSTRAINT pknextgen_EnterpriseEntity PRIMARY KEY
> )
>
> or perhaps
>
> CREATE TABLE nextgen_EnterpriseEntity (
> name VARCHAR(256) PRIMARY KEY,
> otherField INTEGER
> )
>
> ?
>
> At least, that's the syntax that HSQL understands.
>
> InstantDB doesn't seem to recognise CONSTRAINT at all, but it would work
> with the latter syntax.
>
> The syntax that's currently used appears to be correct for PostgreSQL.
> The latter should also work for that.
>
> I propose remove the "CONSTRAINT pkfoo" bit. Any objections?
>
> Regards,
>
> Toby.