db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Pugh" <ep...@upstate.com>
Subject HSQLDB Connection Info
Date Sat, 31 Jan 2004 23:53:37 GMT
Hi all,

I am attempting to use Hypersonic with Scarab to do in memory unit testing
of the Torque generated objects.  However, I can't seem to get the right
incantation to start up things.

I am using hsqldb-1.7.1.jar, with Torque 3.1.  I am trying to get back this
error:

Caused by: java.lang.NullPointerException: There was no DataSourceFactory
configured for the connection scarab
	at org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:749)
	at org.apache.torque.Torque.getConnection(Torque.java:306)
	at org.apache.torque.util.Transaction.beginOptional(Transaction.java:118)
	at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1365)
	... 26 more


There are my settings:

torque.database.default=scarab
torque.database.scarab.adapter=hypersonic

## Using Jdbc2Pool
torque.dsfactory.scarab.factory=org.apache.torque.dsfactory.SharedPoolDataSo
urceFactory
torque.dsfactory.scarab.pool.defaultMaxActive=30
torque.dsfactory.scarab.pool.defaultMaxWait=30000
torque.dsfactory.scarab.pool.testOnBorrow=true
torque.dsfactory.scarab.pool.timeBetweenEvictionRunsMillis=-1
torque.dsfactory.scarab.pool.validationQuery=SELECT 1
torque.dsfactory.scarab.connection.driver = org.hsqldb.jdbcDriver
torque.dsfactory.scarab.connection.url = jdbc:hsqldb:.
#torque.dsfactory.scarab.connection.url =
jdbc:hsqldb:c:\\temp\\hsqldb\\scarab
torque.dsfactory.scarab.connection.user = sa
torque.dsfactory.scarab.connection.password =
.

I saw this post:
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=torque-user@db.apache.or
g&msgId=426900 and tried to get things to work but I get the same  issue.

I also created this unit test:
public void testStartingTorque() {
		try {
			Configuration config =
				new PropertiesConfiguration("src/test/TestTurbineResources.properties");

			Torque.init(config);

			System.out.println("Success Initing Torque!");
			ActivityManager.getInstance(new Long(1));
		} catch (Exception e) {
			System.out.println("Can't initialize Torque!!");
			e.printStackTrace();
		}
	}

I successfully init torque, but when I try and get an instance, I get this
exception, and then the above Exception...

org.apache.torque.TorqueException:
org.apache.commons.dbcp.SQLNestedException: Could not retrieve connection
info from pool, cause: Could not create a validated object
	at org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:755)
	at org.apache.torque.Torque.getConnection(Torque.java:306)
	at
org.tigris.scarab.om.BaseActivityPeer.retrieveByPK(BaseActivityPeer.java:762
)


If you check CVS HEAD of Scarab out (http://scarab.tigris.org) and try and
run the unit tests you will see the problem.  If I point to MSSQL,
everything works fine, so it is something in the Torque to Hypersonic to
DBCP to Pool stuff...

Eric Pugh


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