Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 49460 invoked from network); 18 Mar 2005 06:56:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 18 Mar 2005 06:56:29 -0000 Received: (qmail 16448 invoked by uid 500); 18 Mar 2005 06:56:27 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 16422 invoked by uid 500); 18 Mar 2005 06:56:26 -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 16408 invoked by uid 99); 18 Mar 2005 06:56:26 -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 mail.seitenbau.net (HELO mail.seitenbau.net) (194.175.229.106) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 17 Mar 2005 22:56:26 -0800 Received: from [195.127.188.18] (helo=www.seitenbau.net) by router1.seitenbau.net with esmtp (Exim 4.43) id 1DCBP2-0006IC-TW for torque-user@db.apache.org; Fri, 18 Mar 2005 07:56:13 +0100 In-Reply-To: <20050317121052.45961.qmail@web41402.mail.yahoo.com> Subject: RE: doDelete problem, null dbMap To: "Apache Torque Users List" X-Mailer: Lotus Notes Release 6.0 September 26, 2002 Message-ID: From: Thomas Fischer Date: Fri, 18 Mar 2005 07:56:11 +0100 X-MIMETrack: Serialize by Router on www/seitenbau(Release 6.5.1|January 21, 2004) at 18.03.2005 07:56:11 AM MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Jim, Thanks for investigating this further. I wanted to make sure its not an error in the Torque code. No idea about the date issue. I am also getting this, but as I do not need dates sooner than 1970, I did not investigate it further. Keep us informed if you have any new informations about it. Thomas Jim Caserta schrieb am 17.03.2005 13:10:52: > That's exactly it Thomas. I was setting the dbName > when I did not have to, which set up a different > dbMap. Thank you for all your help. > > I'm trying to do inserts now and I'm getting an error > message that a Date field cannot be before 01/01/70. I > have never had this happen in version 3.0. > Still trying to work that one out inbetween other > projects. I will have to check out the release notes > to see if there were changes to Date fields. > > Thanks! > Jim > --- Thomas Fischer wrote: > > > > > > > > > > > > > Jim, > > > > are you sure you used setDbName() correctly ? The > > setDbName() is for ther > > following scenario: In the schema.xml used by the > > generator, one can define > > different s which have a different > > structure. The generated > > classes know which they belong to. Then, > > in the runtime, you > > can assign different connection-urls to the > > different s. But as > > the structure of the s" may differ, this > > means that Torque has to > > keep a dbMap for each . So if you set the > > dbName in criterion, it > > uses a different dbMap. If this map does not have > > the correct entries, the > > doDelete fails. > > > > This scenario is different from the case where you > > have different databases > > (e.g. on different servers) with the same structure. > > For this, you have to > > provide different runtime properties, but you must > > not change the name of > > the database in the criteria. > > > > In general, if you just have one element > > in your schema.xml and > > just one database to connect to, you need not worry > > about the database name > > within the runtime. > > > > Thomas > > > > > > Jim Caserta schrieb am > > 16.03.2005 13:44:44: > > > > > Thomas, > > > > > > I did some further looking at what I changed and > > > attempted to re-create the problem. > > > It appears that setting the DbName with the actual > > > HighLevel qualifier for the tables (was "default" > > > previously) wreaked havoc with the "tables" > > hashtable > > > in the dbMap (line commented out below) in the > > > criteria. > > > > > > I cannot explain it, but it happens consistently. > > > > > > criteria.add(TableNamePeer.OFFRG_N, primaryKey); > > > //criteria.setDbName(db2Schema); > > > TableNamePeer.doDelete(criteria, dbConn); > > > > > > > > > --- Thomas Fischer wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > Jim, > > > > > > > > I still not understand the cause of the problem > > and > > > > your solution. What did > > > > you do to make the error do away ? > > > > > > > > Looking at the generated code, I do not see how > > > > accessing the static method > > > > of one table could possibly initialize or > > > > re-initialize the Map builder of > > > > another table. > > > > > > > > Thomas > > > > > > > > > > > > Jim Caserta schrieb am > > > > 15.03.2005 20:00:02: > > > > > > > > > Thomas, > > > > > > > > > > You are right. It appears that by executing > > the > > > > > following: > > > > > BaseTABLENAMEPeer.executeStatement("SET > > CURRENT > > > > SQLID > > > > > = '" + > > > > > db2Schema... > > > > > for each of the tables that would have been > > > > deleted in > > > > > a Cascade Delete, it somehow re-initialized > > Tables > > > > in > > > > > the dbMap. > > > > > > > > > > Now all I have to do is get the Updates and > > > > Inserts > > > > > working.. > > > > > Thanks for all your help! > > > > > > > > > > Jim > > > > > > > > > > --- Thomas Fischer > > wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Jim, > > > > > > > > > > > > Sorry, I should have read your mail more > > > > cautiously; > > > > > > I was again > > > > > > mistaken... > > > > > > But nonetheless, I am still confused. > > > > > > > > > > > > There should be code in the generated > > > > xxxBasePeer > > > > > > class which looks like > > > > > > > > > > > > public static MapBuilder > > > > getMapBuilder(String > > > > > > name) > > > > > > { > > > > > > try > > > > > > { > > > > > > MapBuilder mb = (MapBuilder) > > > > > > mapBuilders.get(name); > > > > > > // Use the 'double-check > > pattern' > > > > for > > > > > > syncing > > > > > > // caching of the MapBuilder. > > > > > > if (mb == null) > > > > > > { > > > > > > synchronized (mapBuilders) > > > > > > { > > > > > > mb = (MapBuilder) > > > > > > mapBuilders.get(name); > > > > > > if (mb == null) > > > > > > { > > > > > > mb = (MapBuilder) > > > > > > Class.forName(name).newInstance(); > > > > > > // Cache the > > MapBuilder > > > > > > before it is built. > > > > > > > > mapBuilders.put(name, > > > > mb); > > > > > > } > > > > > > } > > > > > > } > > > > > > .... > > > > > > > > > > > > This should cache the map builder in the > > dbMap. > > > > The > > > > > > method is called from > > > > > > the static initializer of the xxxBasePeer > > class, > > > > > > which should be called at > > > > > > the latest when you call xxxPeer.DoDelete(). > > If > > > > you > > > > > > have the possibility to > > > > > > debug your code, you might want to put a > > > > breakpoint > > > > > > in there and see > > > > > > whether and when it it called. > > > > > > > > > > > > There are two reasons I can think of why the > > > > Table > > > > > > does not appear in the > > > > > > dbMap (there might be more) > > > > > > 1) Torque is not initialized or it is > > > > initialized > > > > > > more than once > > > > > > 2) For some obscure reason, the xxxBasePeer > > > > class is > > > > > > not loaded while you > > > > > > execute the doDelete(). > > > > > > > > > > > > To exclude 2), you can force the classLoader > > to > > > > load > > > > > > the xxxBasePeer class > > > > > > by issuing > > > > > > > > > === message truncated === > > > > > __________________________________ > Do you Yahoo!? > Yahoo! Small Business - Try our new resources site! > http://smallbusiness.yahoo.com/resources/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org