db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabian Moerchen <fab...@mybytes.de>
Subject Re: hypersonic primarykey's
Date Mon, 29 Sep 2003 10:06:21 GMT

this is a response to 

From: Ryan Christianson
Subject: hypersonic primarykey's
Date: Thu, 14 Aug 2003 16:43:44 -0700

Ryan, i hope you are still reading this list, i just joined it (again).
or maybe there is anyone else who can help me?

i am trying get my torque project working with hsqldb 1.7.1 (it is
working fine with mysql) and had the same problems as Ryan, but his
solution didn't work for me:

- using the schema (with defaultIdMethod="native") that worked for mysql
as is, resulted in trying to add null values into the non-nullable ID
columns: "org.apache.torque.TorqueException: Try to insert null into a
non-nullable column in statement..." 
while querying the empty tables worked fine.

- when adding autoIncrement="true" for each ID column, the database
creation failed with "java.sql.SQLException: Attempt to define a second
primary key in statement"

- after commenting out the "PRIMARY KEY" line in
sql/base/hypersonic/primarykey.vm the database creation worked again,
but i did not only loose the extraneous primary key definitions for the
ID column in each table, but also primary keys over several columns had
defined for m-n tables. note, that my hsqldb script file the id columns
are defined as "ID integer IDENTITY" not "INTEGER NOT NULL IDENTITY
PRIMARY KEY" as reported by Ryan.

- thus i reverted primarykey.vm and instead manually replaced
and removed any "PRIMARY KEY (ID)" in the generated sql file.
database creation worked fine, again.

- but in both cases, trying to insert a dataset i get:
"org.apache.torque.TorqueException: Unexpected token: LAST_INSERT_ID in
statement [SELECT LAST_INSERT_ID()]"

how can i get rid of this error?


To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

View raw message