Your modification doesn't change the situation.
Here's the stack trace
[TEST] org.exolab.castor.jdo.QueryException: com.sap.dbtech.jdbc.exceptions.DatabaseException: [500]: Lock request timeout
[TEST] at org.exolab.castor.jdo.engine.SimpleQueryExecutor.execute(SimpleQueryExecutor.java:127)
[TEST] at org.exolab.castor.jdo.engine.OQLQueryImpl.execute(OQLQueryImpl.java:535)
[TEST] at org.exolab.castor.jdo.engine.OQLQueryImpl.execute(OQLQueryImpl.java:488)
[TEST] at org.exolab.castor.jdo.engine.OQLQueryImpl.execute(OQLQueryImpl.java:453)
[TEST] at Main.run(Main.java:76)
[TEST] at Main.main(Main.java:23)
Regards, michael
At 18:51 10.09.2003 +0000, you wrote:
This one time, at band camp, michael simons said:
ms>There's the following bug in Castor JDO:
ms>
ms>If you created an object of class C and later in the same transaction you
ms>query the number of objects of class C (select count(*)), the second query
ms>throws a QueryException "query timeout".
ms>
ms>Please verify the bug with the following code snippet you can run on the
ms>example database supplied by Castor. Please let me know if You get the same
ms>result.
...
ms>public void run() throws Exception {
ms>Database db = _jdo.getDatabase();
ms>
ms>db.begin();
ms>{
ms>OQLQuery qry = db.getOQLQuery("select g from ProductGroup g where id=$1");
ms>qry.bind(new Long(3));
ms>QueryResults results = qry.execute();
ms>if (results.hasMore()) {
ms>ProductGroup pg = (ProductGroup) results.next();
ms>qry = db.getOQLQuery ("select count(*) from "
ms>+ ProductDetail.class.getName()
ms>+ " d where d.product.group=$1");
ms>qry.bind(pg);
ms>results = qry.execute();
ms>if (results.hasMore()) {
ms>java.math.BigDecimal num = (java.math.BigDecimal) results.next();
ms>_writer.println("count = " + num);
ms>}
results.close();
qry.close();
ms>Product p = (Product) db.load(Product.class, new Integer(586));
ms>ProductDetail detail = new ProductDetail();
ms>detail.setName("Bibifax");
ms>detail.setProduct(p);
ms>db.create(detail);
ms>qry = db.getOQLQuery ("select count(*) from "
ms>+ ProductDetail.class.getName()
ms>+ " d where d.product.group=$1");
ms>qry.bind(pg);
ms>results = qry.execute(); // !! This is where you get a request time out !!
ms>if (results.hasMore()) {
ms>java.math.BigDecimal num = (java.math.BigDecimal) results.next();
ms>_writer.println("count = " + num);
ms>}
ms>}
ms>}
results.close();
qry.close();
ms>db.commit();
ms>
ms>db.close();
ms>_writer.println("Test complete");
ms>}
Michael,
Try adding my additions above and see what result you achieve. I'm
not sure what will happen exaclty. Please post the stack trace for the
query timeout exception.
Bruce
--
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
The Castor Project
http://www.castor.org/
Apache Geronimo
http://incubator.apache.org/projects/geronimo.html
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
