Thanks for your reply.
Yes, I used ant init to set up my database connectivity.
I do have an ID_TABLE. In that table I have a row for each turbine_ table
and one for the RDF table. I did have a question about ID_TABLE though.
The example
id-table-schema.xml has an autoincrement attribute in the column tag.
I removed that - but wasn't sure what to replace it with. At this point I
have set
the table tag's idMethod attribute to "idBroker" - for no good reason. In
the case of using IDBroker, how does the ID_TABLE need to be handled?
I am using a single database, all my turbine_ tables and the RDF table and
the
ID_TABLE have been created in a schema named turbine in an Oracle 8.1.7
database.
The confounding situation is that I am successfully inserting data into the
user,
group, role tables using the IDBroker approach. It is just the RDF inserts
that are
unsuccessful.
-----Original Message-----
From: Jason van Zyl [mailto:[EMAIL PROTECTED]]
Sent: 10 June 2001 16:35
To: [EMAIL PROTECTED]
Subject: Re: Oracle and newapp - again
On 6/7/01 3:52 AM, "Heather Boyd" <[EMAIL PROTECTED]> wrote:
>
> I have changed the demo app schema building xml files to the following :
>
> <database>
> <table name="RDF" idMethod="idBroker">
> <column name="RDF_ID" required="true" primaryKey="true" type="INTEGER"/>
> ...
>
> <database>
> <table name="TURBINE_PERMISSION" idMethod="idbroker">
> <column name="PERMISSION_ID" required="true" primaryKey="true"
> type="INTEGER"/> ....
>
>
>
> As a result I no longer get the error mesage :
>
> ORA-01400: cannot insert NULL into ("TURBINE"."RDF"."RDF_ID")
>
> and I can successfully insert rows into the user/group/roles/permission
> tables.
>
>
>
> However I am still having problems inserting into the RDF table. I get
the
> following message :
>
> Exception: java.lang.reflect.InvocationTargetException
> Stack Trace follows:
> java.lang.reflect.InvocationTargetException:
> java.lang.NullPointerException
> at org.apache.turbine.om.peer.BasePeer.doInsert(BasePeer.java:742)
>
> which corresponds to this line of code :
>
> // If the keyMethod is SEQUENCE or IDBROKERTABLE, get the id
> // before the insert.
> if (keyGen.isPriorToInsert())
>
>
> Does anyone recognize this problem? Is there something that Im not doing?
It looks like a problem with the IDBroker setup. How did you setup
the application? Did you use 'init' target? It looks like the table
that IDBroker needs for keeping track of Ids is not present so that
you are not getting an Id when inserting which is not allowed because
the primary key cannot be null.
You must have a table like the following setup for the IDBroker so
it has somewhere to store/retrieve Ids.
# -----------------------------------------------------------------------
# ID_TABLE
# -----------------------------------------------------------------------
drop table if exists ID_TABLE;
CREATE TABLE ID_TABLE
(
ID_TABLE_ID INTEGER NOT NULL,
TABLE_NAME VARCHAR (255) NOT NULL,
NEXT_ID INTEGER,
QUANTITY INTEGER,
PRIMARY KEY(ID_TABLE_ID),
UNIQUE (TABLE_NAME)
);
If this isn't the problem than you might possibly have a mismatch
in your configuration file. Are you using a single database
configuration i.e. you have something like the following:
database.default.driver=org.gjt.mm.mysql.Driver
database.default.url=jdbc:mysql://127.0.0.1/newapp
database.default.username=user
database.default.password=password
Sometimes if you are using multiple databases you accidentally
reference the wrong pool. Are you using multiple databases?
--
jvz.
http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]