db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brandon Mayes" <eff4...@hotmail.com>
Subject doSelect() on cloudscape having issues
Date Thu, 03 Mar 2005 15:10:08 GMT
This may be something that I need to submit as a bug...I'm not quite sure 
yet but can anyone tell me why this statement would fail?  I have a 
Cloudscape DB with 2 tables in it, PATIENT and STATE.  STATE contains the 50 
US states plus Dist. of Columbia in it, so 51 entries.  They do exist in the 
database, I can verify that by connecting through a command prompt.  The 
state_id column in PATIENT references the state_id field in the STATE db as 
a foreign key.  So I run torque and build all of the XML from a JDBC 
connection, then it creates all of the corresponding Java classes and 
everything is good.

Now I have built a test class because my JSP stuff wasn't retrieving DB 
information.  So in my test class I call this retrieve() method I have built 
into state.  The call is simple:

List li = State.retrieve(null);

Which calls my State.retrieve() method....

public static List retrieve (Map m)
{
	// if map is null or empty then return a select statement
	// based on a new (empty) criteria

	if ( (m == null) || (m.isEmpty()) )
	{
		try
			{return StatePeer.doSelect( new Criteria() );}
		catch (Exception e)
			{
				e.printStackTrace();
				return new ArrayList();
			}
	}

	// otherwise add the fields to a criteria and doSelect on a
	// populated criteria....


My code errors out on the StatePeer.doSelect() call.  It returns an 
exception instead of giving me the list of the states that are in the DB.  
Here is the stack trace that's printing out:


org.apache.torque.TorqueException: 
org.apache.commons.dbcp.SQLNestedException: Could not retrieve connection 
info from pool
	at org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:717)
	at org.apache.torque.Torque.getConnection(Torque.java:268)
	at org.apache.torque.util.Transaction.beginOptional(Transaction.java:80)
	at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1195)
	at asdf.BaseStatePeer.doSelectVillageRecords(BaseStatePeer.java:352)
	at asdf.BaseStatePeer.doSelectVillageRecords(BaseStatePeer.java:325)
	at asdf.BaseStatePeer.doSelect(BaseStatePeer.java:293)
	at asdf.State.retrieve(State.java:63)
	at a.Testing.main(Testing.java:29)
Caused by: org.apache.commons.dbcp.SQLNestedException: Could not retrieve 
connection info from pool
	at 
org.apache.commons.dbcp.datasources.SharedPoolDataSource.getPooledConnectionAndInfo(SharedPoolDataSource.java:169)
	at 
org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection(InstanceKeyDataSource.java:631)
	at 
org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection(InstanceKeyDataSource.java:615)
	at org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:705)
	... 8 more
Caused by: java.util.NoSuchElementException: Could not create a validated 
object
	at 
org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:783)
	at 
org.apache.commons.dbcp.datasources.SharedPoolDataSource.getPooledConnectionAndInfo(SharedPoolDataSource.java:165)
	... 11 more






All of this code works flawlessly with a MySQL database.  I would say that 
perhaps my code was wrong except I know it's good in MySQL.  Anyone seen 
this before?

-Brandon

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to 
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement


---------------------------------------------------------------------
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