db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tuncay Baskan (─░nternet Grubu) <Tuncay.Bas...@intertech.com.tr>
Subject I hate IdGenerator
Date Sat, 21 Dec 2002 15:51:52 GMT
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