Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 9440 invoked from network); 28 Apr 2005 17:28:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Apr 2005 17:28:12 -0000 Received: (qmail 25605 invoked by uid 500); 28 Apr 2005 17:29:18 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 25582 invoked by uid 500); 28 Apr 2005 17:29:18 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 25566 invoked by uid 99); 28 Apr 2005 17:29:17 -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: domain of gcjttd-turbine-torque-dev@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 28 Apr 2005 10:29:17 -0700 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DRCgb-0004vL-OD for torque-dev@db.apache.org; Thu, 28 Apr 2005 19:20:25 +0200 Received: from 234.red-80-32-213.pooles.rima-tde.net ([80.32.213.234]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Apr 2005 19:20:25 +0200 Received: from jorge.uriarte by 234.red-80-32-213.pooles.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Apr 2005 19:20:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: torque-dev@db.apache.org From: Jorge Uriarte Subject: IDBROKER generated ids suddenly becomes HUGE Date: Thu, 28 Apr 2005 19:25:12 +0200 Lines: 104 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 234.red-80-32-213.pooles.rima-tde.net User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en Sender: news X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi there, out there in Scarab we're facing a strange bug that is driving us crazy. We're currently using torque-3.1.1 and torque-gen-3.1.1-dev You can take a look at the bug here (no user required): http://www.solitone.org/scarab/issues/id/SCB1514 The problem, in a few words, is that "sometimes" (recipe still missing) the ID number returned by the IDBROKER is HUGEEEE. The value is not the primary key for a table (its the number part of the issue ID, you know scarab ;-) ). I guess the code below (java, and id_table.xml) is the responsible: (full code here http://svn.collab.net/viewcvs/scarab/trunk/src /java/org/tigris/scarab/om/Issue.java?rev=9569&view=markup) It's *old* code, and I don't really know why did it started failing, but I somehow don't dare to change it... There are several things I don't understand in it: * It seems to expect the first call to getIdAsInt failing, and then it tries again synchronizing the call... * If it fails again, it asumes it does not exist (!) and then starts the count from 1 (this might be to make sure it finds a record in ID_TABLE for a new module) private int getNextIssueId(Connection con) throws Exception { int id = -1; String key = getIdTableKey(); DatabaseMap dbMap = IssuePeer.getTableMap().getDatabaseMap(); IDBroker idbroker = dbMap.getIDBroker(); try { id = idbroker.getIdAsInt(con, key); } catch (Exception e) { synchronized (idbroker) { try { id = idbroker.getIdAsInt(con, key); } catch (Exception idRetrievalErr) { // a module code entry in the id_table was likely not // entered, insert a row into the id_table and try again. try { saveIdTableKey(con); id = 1; } catch (Exception badException) { getLog().error("Could not get an id, even after " +"trying to add a module entry into the ID_TABLE", e); getLog() .error("Error trying to create ID_TABLE entry for " + getIdTableKey(), badException); // throw the original throw new ScarabException( L10NKeySet.ExceptionRetrievingIssueId, badException); } } } } return id; } This is the definition of the ID_TABLE:
Any hint about where the problem would be? Any idea about why is this code so *strange*? Thanks!! _ Jorge --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org