db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From EP...@upstate.com
Subject RE: I hate IdGenerator
Date Sun, 22 Dec 2002 17:57:33 GMT
Not sure why you are getting those errors(but I think native is bad or
something), here is my config:

<database name="default" package="com.upstate.kinaseprofiler.torque.db.om"
defaultIdMethod="native" baseClass="BaseObject" basePeer="BasePeer"
    <table name="AUDIT" javaName="Audit" idMethod="none">
      <column name="AUDIT_ID" javaName="AuditId" primaryKey="true"
required="true" type="INTEGER" />
      <column name="NAME" javaName="Name" required="true" type="VARCHAR" />
      <column name="DESCRIPTION" javaName="Description" required="true"
type="VARCHAR" />
      <column name="OBJECT_NAME" javaName="ObjectName" required="false"
type="VARCHAR" />
      <column name="OBJECT_ID" javaName="ObjectId" required="false"
type="VARCHAR" />
      <column name="OBJECT_TYPE" javaName="ObjectType" required="false"
type="VARCHAR" />
      <column name="AUDIT_DTIME" primaryKey="false" required="true"
      <column name="USERNAME" javaName="Username" required="false"
type="VARCHAR" />


Eric Pugh

-----Original Message-----
From: Tuncay Baskan (Internet Grubu)
Sent: Saturday, December 21, 2002 10:52 AM
To: Turbine-Torque-User (E-mail)
Subject: I hate IdGenerator

Torque works without a problem when used from a non-webapplication. I'm able
to save() my objects which have autoIncrement primary keys.

But when using Torque in a web application I'm getting
	"IdGenerator for table xxx is null"
for every table which has an autoincrement primary key.

For example; in a struts action I have the following:
	Department dept = new Department();
and in a command line application written for testing I have exactly the
same code but it is working without a problem.

I think there is only one difference between them. The command line
version initiates its own connection pooling and gets the connection
from that pool. The web application which uses Tomcat as server 
initiates Torque from a servlet with Tomcat's JNDI resource mechanism.

Is this a configuration problem? If so how can I correct the problem.

Btw here is the relevant portions of my schema:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?>
<!DOCTYPE database SYSTEM 
name="eproject" defaultIdMethod="native">

<table name="department" idMethod="native">
	<column name="department_id" required="true" primaryKey="true"
	<column name="name" required="true" size="50" type="VARCHAR"/>


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message