You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Mark Lybarger <Ma...@CBC-Companies.com> on 2003/03/03 14:18:48 UTC

null connection object

I'm using the TDK 2.2.01 and have it working with my oracle database and
velocity templates.  My trouble is that when i try to insert a record that
already exists (pk violation), an exception is thrown.  i can catch the
exception, but when i try to call select on the peer, the connection object
is null and an exception is thrown there.  

        try 
        {
		// exception thrown here for pk violation
        	ProductIdPeer.doInsert(criteria);
        } catch ( Exception e)
        {
        	context.put("exceptionMessage", e.getMessage());
        }
		// null connection thrown here.
        List productList = ProductIdPeer.doSelectAll();

i've searched a little on the mailing list archives and there's some mention
of giving back connections?  in my code, i'm not doing anything with
connections at all, i thought the om classes handled all that.  does anyone
have ideas why the connection is being used as null?  is there an easy know
fix for this?

Mark Lybarger
Mark.Lybarger@cbc-companies.com
CBC Companies
614.442.3741

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.455 / Virus Database: 255 - Release Date: 2/13/2003
 

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


Re: null connection object

Posted by Eric Emminger <er...@ericemminger.com>.
Mark

It's possible, although I'm not sure and could be very wrong, that when 
Torque throws that exception, it also returns the connection to the pool.

What id method are you using on that table? I'm guessing you're using 
"none" since you are supplying the pk that's giving you the first exception.

Eric

> I'm using the TDK 2.2.01 and have it working with my oracle database and
> velocity templates.  My trouble is that when i try to insert a record that
> already exists (pk violation), an exception is thrown.  i can catch the
> exception, but when i try to call select on the peer, the connection object
> is null and an exception is thrown there.  


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