Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 8054 invoked from network); 14 Sep 2004 15:29:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 14 Sep 2004 15:29:38 -0000 Received: (qmail 99260 invoked by uid 500); 14 Sep 2004 15:29:34 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 99161 invoked by uid 500); 14 Sep 2004 15:29:32 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 99148 invoked by uid 99); 14 Sep 2004 15:29:32 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [217.110.121.208] (HELO mail.hpc-hamburg.de) (217.110.121.208) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 14 Sep 2004 08:29:30 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.0.6556.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: AW: blocking calls, query timeout Date: Tue, 14 Sep 2004 17:22:43 +0200 Message-ID: <96F363742E3BAF4EBE5EA6A846DA14B417EF1F@mail.hpc-hh.de> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Antwort: AW: Antwort: blocking calls, query timeout Thread-Index: AcSWdvfDX7W8tTEvS2icAydFFE3z1QD9Q7tg From: "Sperlich, Tino" To: "Apache Torque Users List" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Arne, excuse my late answer, I've been away for awhile. But now, back in full swing, I'd like to=20 thank you a lot for your suggestion,=20 it works perfectly for me!!!! I get this stack trace and a resonable exception: Caused by: java.sql.SQLException: ORA-00054: Versuch, mit NOWAIT eine = bereits belegte Ressource anzufordern. at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169) at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208) at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543) at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405) at = oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:643)= at = oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:18= 19) at = oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.j= ava:2015) at = oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:571)= at com.workingdogs.village.QueryDataSet.(QueryDataSet.java:113) at org.apache.torque.util.BasePeer.executeQuery(BasePeer.java:1539) man, that's just great.=20 of course, I need to carefully choose which doselect to use in order not to open long transactions myself, and I might need to adjust the save() method to,=20 but so far I'm done. Is the nowait option ANSI compliant or is it oracle specific? Best regards, Tino -----Urspr=FCngliche Nachricht----- Von: arne.siegel@pta.de [mailto:arne.siegel@pta.de] Gesendet: Donnerstag, 9. September 2004 16:16 An: Apache Torque Users List Betreff: Antwort: AW: Antwort: blocking calls, query timeout Hi Tino, good question . . . One would like to be able to override the createQueryString method of = the XxxPeer class, but - alas! - it is a static method :-( The only solution I see is implement some additional methods in your XxxPeer class that do everything that's already in the BaseXxxPeer = class, but with the modified select statement (please note that I have appended "ForUpdateNowait" to the method names): public static Xxx retrieveByPKForUpdateNowait(ObjectKey pk, = Connection con) throws TorqueException, NoRowsException, TooManyRowsException { Criteria criteria =3D buildCriteria(pk); List v =3D doSelectForUpdateNowait(criteria, con); if (v.size() =3D=3D 0) { throw new NoRowsException("Failed to select a row."); } else if (v.size() > 1) { throw new TooManyRowsException("Failed to select only one row."); } else { return (Xxx)v.get(0); } } public static List doSelectForUpdateNowait(Criteria criteria, Connection con) throws TorqueException { return populateObjects(doSelectForUpdateNowaitVillageRecords(criteria, con)); } public static List doSelectForUpdateNowaitVillageRecords(Criteria criteria, Connection con) throws TorqueException { if (criteria.getSelectColumns().size() =3D=3D 0) { addSelectColumns(criteria); } // Set the correct dbName if it has not been overridden // criteria.getDbName will return the same object if not set to // another value so =3D=3D check is okay and faster if (criteria.getDbName() =3D=3D Torque.getDefaultDB()) { criteria.setDbName(DATABASE_NAME); } // BasePeer returns a List of Value (Village) arrays. The array // order follows the order columns were placed in the Select clause. // if (con =3D=3D null) // { // return BasePeer.doSelect(criteria); // } // else // { // return BasePeer.doSelect(criteria, con); // } return BasePeer.executeQuery( createQueryString(criteria) + " FOR UPDATE NOWAIT", criteria.getOffset(), criteria.getLimit(), criteria.isSingleRecord(), con); } Please note that this code presumes you have a non-null Connection con = when invoking retrieveByPKForUpdateNowait. I have not tested if this code actually works, but perhaps you've got = the time to do this and report your experience back... Gruss Arne --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org