Steffen,
can you please provide a small package that includes amogst other things ...
a) a mapping file (mapping.xml)
b) a jdo configuration file (database.xml)
c) a Java class (preferably a JUnit test case) that executes a test case that demonstrates your problem
d) a sql schema (if available)
e) a short problem description.
and I'll haver a look at this problem. Please do not forget to delete all non-relevant fragments of these files from whatever you supply.
Regards
Werner
--Original Message Text---
From: Schlachter, Steffen (LDS)
Date: Thu, 7 Aug 2003 09:53:16 +0200
Hello,
I am working with Castor JDO on a Tomcat application server and I am using Apache Commons DBCP for connection pooling to get a connection to an Ingres database.
If a table in the database is locked the code (see below) stops on the oql.execute() statement and waits forever. What I need is a sort of timeout that throws an exception if the request cannot be fulfilled within a certain time.
Is there any mechanism in Castor JDO that allows me to set a timeout for the required purpose? I believe that the LockTimeout doesn't work as my requests are read-only. I'm looking for something like the setQueryTimeout() in java.sql.Statement interface.
jdo = new JDO();
jdo.setDatabaseName( "aDatabase" );
jdo.setConfiguration( "database.xml" );
jdo.setClassLoader( getClass().getClassLoader() );
db = jdo.getDatabase();
db.begin();
oql = db.getOQLQuery("SELECT ...");
results = oql.execute(Database.ReadOnly);
db.commit();
db.close();
Thanks for your help,
Steffen
- Re: [castor-dev] Timout on Executing Query needed Werner Guttmann
- Re: [castor-dev] Timout on Executing Query needed Werner Guttmann
