On Tue, 2004-04-06 at 12:58, Thomas Dudziak wrote:
> You don't specify a sequence manager (high-low is the default if I'm not
> mistaken which means that OJB generates the pk value independent from the
> database), and the Product.id field is autoincrement, but you also have in
> the database the corresponding column as SERIAL (which means autoincrement
> on the database side).
> You could try using the SequenceManagerNativeImpl in which case you should
> also specify the Product.id field as access='readonly'.
>
> Tom
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
Oh, excuse me, I sent the wrong sql script. The db creation script is
the following:
---- begining create_db_noseq.sql ----
CREATE TABLE product(
id INTEGER PRIMARY KEY,
name VARCHAR(50),
price DECIMAL(12,5),
stock INTEGER
);
INSERT INTO product (id,price,name,stock) VALUES (0, 5.4, 'Conflictive
Product', 3);
INSERT INTO product (id,price,name,stock) VALUES (1, 5.99, 'video', 9);
INSERT INTO product (id,price,name,stock) VALUES (2, 8.43, 'car', 400);
INSERT INTO product (id,price,name,stock) VALUES (3, 25.3, 'house', 8);
INSERT INTO product (id,price,name,stock) VALUES (4, 3.8, 'computer',
3000);
INSERT INTO product (id,price,name,stock) VALUES (5, 87.46, 'book',
100);
INSERT INTO product (id,price,name,stock) VALUES (6, 9.4, 'printer', 4);
INSERT INTO product (id,price,name,stock) VALUES (7, 7.29, 'television',
6);
INSERT INTO product (id,price,name,stock) VALUES (8, 20.3, 'window',
10);
---- end create_db_noseq.sql ----
Anyway it fails in both cases (SERIAL or INTEGER) in the same way.
We have already solve this problem using SequenceManagerNextValImpl and
it works well (*). We dont use OJB to provide sequences so we really
dont have a need to solve the core problem, im just reporting this issue
because it came across our way.
(*) The problems we had before were a configuration issue.
Greets,
Martin Ivan Levi
Universitat Politecnica de Catalunya
Centre Tecnologic de Transferencia de Calor
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]