db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dowell Griffin" <dow...@bizrainbow.com>
Subject Torque.getConnection() hangs - help
Date Thu, 22 Jul 2004 00:20:17 GMT
I have successfully been using Torque to connect to hsqldb within a JBoss
J2EE environment.  I want to use it from my Netbeans IDE to do some
debugging (debugging not related to Torque).

I must have something wrong in the properties file. I know that there is a
difference when JBoss is not managing the connection pool.

Some of this is new to me so I may be overlooking something fundamental.

Config:

hsqldb (Hypersonic)
Windows 2000
Java 1.4.2
JBoss 3.2.3 (but connections work when JBoss is the connection manager)

When running from my IDE:

Any connection attempt inside my torque classes hangs.

I can make the problem surface like this:

  Torque.init(<file>);
  java.sql.Connection  con=Torque.getConnection();  // this never returns

I can do this, bypassing Torque, and get a connection with no problems:
  java.sql.DriverManager.getConnection("jdbc:hsqldb:hsql://127.0.0.1:9001",
"sa", " ");

When it hangs I pause the debugger and look at the stack trace and see the
stack shown at the end of this post. This suggests Torque 'thinks' all is
well or it would not have gone so far as to attempt to open the connection.

There must be something fundamental I am missing.

Here is my property file.  I have tried many version of property files and
some hang and some say the datasource is not configured.


torque.database.createUrl=jdbc:hsqldb:hsql://localhost:9001
torque.database.buildUrl=jdbc:hsqldb:hsql://localhost:9001
torque.database.url=jdbc:hsqldb:hsql://localhost:9001
torque.database.driver=org.hsqldb.jdbcDriver
torque.database.user=sa
torque.database.password=
torque.database.host=localhost
torque.database.default =maindb
torque.database.name =maindb
torque.database.maindb.adapter=hypersonic

torque.dsfactory.maindb.datasource.factory=org.apache.torque.dsfactory.Torqu
eDataSourceFactory
## tried all of these
###org.apache.torque.dsfactory.PerUserPoolDataSourceFactory
###org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS
torque.dsfactory.maindb.datasource.driver=org.hsqldb.jdbcDriver
torque.dsfactory.maindb.datasource.url=jdbc:hsqldb:hsql://localhost:9001
torque.dsfactory.maindb.datasource.user=sa
torque.dsfactory.maindb.datasource.password=

# not sure if this is actually used?
torque.dsfactory.maindb.connection.factory=org.apache.torque.dsfactory.Torqu
eDataSourceFactory

# these 5 are the same for non-J2EE or J2EE
torque.dsfactory.maindb.connection.driver=org.hsqldb.jdbcDriver
torque.dsfactory.maindb.connection.url=jdbc:hsqldb:hsql://localhost:9001
torque.dsfactory.maindb.connection.user=sa
torque.dsfactory.maindb.connection.password=


STACK Trace when hung:

SocketInputStream.socketRead0
org.openide.nodes.PropertySupport$Reflection@37a09861
SocketInputStream.read org.openide.nodes.PropertySupport$Reflection@37a09861
BufferedInputStream.fill
org.openide.nodes.PropertySupport$Reflection@37a09861
BufferedInputStream.read
org.openide.nodes.PropertySupport$Reflection@37a09861
DataInputStream.readInt
org.openide.nodes.PropertySupport$Reflection@37a09861
jdbcConnection.executeHSQL
org.openide.nodes.PropertySupport$Reflection@37a09861
jdbcConnection.execute org.openide.nodes.PropertySupport$Reflection@37a09861
jdbcConnection.setAutoCommit
org.openide.nodes.PropertySupport$Reflection@37a09861
ConnectionImpl.setAutoCommit
org.openide.nodes.PropertySupport$Reflection@37a09861
TorqueClassicDataSource.getConnection
org.openide.nodes.PropertySupport$Reflection@37a09861
TorqueClassicDataSource.getConnection
org.openide.nodes.PropertySupport$Reflection@37a09861
TorqueInstance.getConnection
org.openide.nodes.PropertySupport$Reflection@37a09861
TorqueInstance.getConnection
org.openide.nodes.PropertySupport$Reflection@37a09861
Torque.getConnection
org.openide.nodes.PropertySupport$Reflection@37a09861
TESTER.runRFServer     org.openide.nodes.PropertySupport$Reflection@37a09861
TESTER.main    org.openide.nodes.PropertySupport$Reflection@37a09861




Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message