db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Shea <s...@gtsdesign.com>
Subject Re: NPE in doDelete(Criteria)
Date Tue, 02 Mar 2004 05:05:21 GMT
Whoops, never mind.  I was SURE that I'd assigned a name attribute in
the <database> element but... nope.  Amazing that selects work but
delete doesn't!  Someday I'll look through the code and figure out why.

	Gary

On Mon, 1 Mar 2004, at 16:27 [-0700], Gary Shea (shea@gtsdesign.com) wrote:

> Hi --
> 
> I am encountering an NPE in doDelete(Criteria).  The two following
> snippets are run in an integration test.  The first one works fine, the
> second one throws an NPE.
> 
> -----
>         Criteria criteria = new Criteria("rc4");
> 	criteria.add(SessMainPeer.ID, sessionKey);
> 	criteria.setSingleRecord(true);
> 	Collection sessions = SessMainPeer.doSelect(criteria);
> 
> -----
> 
>         Criteria criteria = new Criteria("rc4");
> 	criteria.add(SessMainPeer.ID, sessionKey);
> 	SessMainPeer.doDelete(criteria);
> 
> -----
> 
> Here's the stack dump:
> 
>     [junit] java.lang.NullPointerException
>     [junit]     at
> org.apache.torque.util.BasePeer.doDelete(BasePeer.java:530)
>     [junit]     at
> org.apache.torque.util.BasePeer.doDelete(BasePeer.java:446)
>     [junit]     at
> xxxxxxxxxxxxxxxxxxxxxxxx.BaseSessMainPeer.doDelete(BaseSessMainPeer.java:495)
>     [junit]     at
> xxxxxxxxxxxxxxxxxxxxxxxx.BaseSessMainPeer.doDelete(BaseSessMainPeer.java:468)
>     [junit]     at
> xxxxxxxxxxxxxxxxxxxxxx.TorqueMerchantSessionDAO.activate(TorqueMerchantSessionDAO.java:32)
>     [junit]     at
> test.jfe.main.util.TorqueMerchantSessionDAOTest.testTorqueMerchantSessionDAO(TorqueMerchantSessionDAOTest.java:105)
>     [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
>     [junit]     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     [junit]     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 
> 
> -------
> 
> Here's the configuration:
> 
> torque.database.rc4.adapter=mysql
> torque.dsfactory.rc4.factory=org.apache.torque.dsfactory.JndiDataSourceFactory
> torque.dsfactory.rc4.jndi.path=java:comp/env/jdbc/rc4
> 
> torque.database.rc4_summary.adapter=mysql
> torque.dsfactory.rc4_summary.factory=org.apache.torque.dsfactory.JndiDataSourceFactory
> torque.dsfactory.rc4_summary.jndi.path=java:comp/env/jdbc/rc4_summary
> 
> 
> 
> 
> I found a reference to this problem on line
> (http://www.mail-archive.com/turbine-user@jakarta.apache.org/msg13240.html)
> but no solution was ever posted.
> 
> When I dump the map for the "rc4" database, it contains only the
> ID_TABLE entry.
> 
> Any hints would be greatly appreciated...
> 
> 	Gary
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message