I'm not sure why a table without a pk would have a non-null keyGen, except a misconfiguration. But if this is the only problem caused by the misconfiguration then it should be ok to test and work around it.
patch applied. john mcnally On Tue, 2002-06-18 at 08:14, Derek Robert Price wrote: > BasePeer was causing a null pointer exception when inserting into tables > without primary keys. I've attached the fix. > > Derek > > -- > *8^) > > Email: [EMAIL PROTECTED] > Public key available from www.keyserver.net - Key ID 5ECF1609 > Fingerprint 511D DCD9 04CE 48A9 CC07 A421 BFBF 5CC2 56A6 AB0E > > Get CVS support at http://2-wit.com > -- > What is this talk of "release?" We do not make software > "releases." Our software "escapes," leaving a bloody trail of > designers and quality assurance people in its wake. > > ---- > > --- torque-3.0-b2/src/java/org/apache/torque/util/BasePeer.java Tue May 7 >01:57:19 2002 > +++ torque-3.0-b2-drp/src/java/org/apache/torque/util/BasePeer.java Fri Jun 14 >14:05:16 2002 > @@ -889,7 +889,7 @@ > > // If the primary key column is auto-incremented, get the id > // now. > - if (keyGen != null && keyGen.isPostInsert()) > + if (pk != null && keyGen != null && keyGen.isPostInsert()) > { > try > { > ---- > > This patch fixes a NullPointerException in BasePeer which occurred when > inserting an entry into a table without a primary key. > > ---- > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
