Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 35070 invoked from network); 9 Feb 2004 18:40:14 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 9 Feb 2004 18:40:14 -0000 Received: (qmail 95048 invoked by uid 500); 9 Feb 2004 18:39:31 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 95017 invoked by uid 500); 9 Feb 2004 18:39:30 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 94920 invoked from network); 9 Feb 2004 18:39:29 -0000 Received: from unknown (HELO mail.funnygarbage.com) (207.101.87.194) by daedalus.apache.org with SMTP; 9 Feb 2004 18:39:29 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Problem with Insert records to the database Date: Mon, 9 Feb 2004 13:39:31 -0500 Message-ID: <794AA7B1BE0DB2458F738486D7353943BF552B@mail.funnygarbage.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Problem with Insert records to the database Thread-Index: AcPvKxWzGcim5eGnT2+lm5Qt5UFzmwAEKtnA From: "Russell Simpkins" To: "Apache Torque Developers List" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N That error would seem to suggest that your Torque is configured to use = Oracle and not postgresql. Postgresql uses curval('name') and = nextval('name'); I may be wrong, but you should double check your configuration. -----Original Message----- From: Sheng Guo [mailto:sheng@in.tum.de] Sent: Monday, February 09, 2004 11:23 AM To: torque-dev@db.apache.org Subject: Problem with Insert records to the database Hello, I am doing a web application project with Turbine2.3+Velocity+Torque. As = a database I have PostgreSQL 7.2. As I tried to insert the data, which=20 I collected from the web page, there was alway an exception: org.apache.torque.TorqueException: ERROR: cnt_test_seq.currval is not=20 yet defined in this session the cnt_test_seq was already defined in the database, but I don't have=20 the "currval" anywhere in the database. How can that happen? I followed the tutorial on the Torque site to write the code, but it=20 didn't work. I had the following code in my Java file: //name of the method, which did the insert public void doSavedata(RunData data, Context context) { //collect data from the Velocity template String name =3D data.getParameters().getString("name"); String beschreibung =3D = data.getParameters().getString("beschreibung"); String identifikator =3D = data.getParameters().getString("identifikator"); String gueltigkeit =3D data.getParameters().getString("gueltigkeit"); =20 CNTTest ct =3D new CNTTest(); //The om class, which was generated by = Torque =20 //set the attributes of the instance of CNTTest Integer id =3D new Integer(2); ct.setId(id); ct.setName(name); ct.setDescription(beschreibung); ct.setAttributeType(identifikator); Integer g =3D new Integer(5); ct.setSortOrder(g); =20 //save in to the database. try { ct.save(); System.out.println("save ok"); context.put("status", "sucess"); System.out.println("context--sucess"); } catch (Exception ex) { String message =3D ex.toString(); System.out.println(message); ex.printStackTrace(); context.put("status", "failed"); context.put("message", message); System.out.println("context--failed"); } I am looking forward to hearing from your earliest reply! yours sincerely Guo --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org