Re: Connecting to keel's hsqldb?
"Michael Nash JGlobal.com" <[email protected]>
| Newsgroups | gmane.comp.java.keel.user |
|---|---|
| Organization | JGlobal |
| Message-ID | <20040408173152.7cddba6a@jglobal> |
Calvin: Had a further thought on the below. Can you try doing an "ant -Ddeploy.name=yourdeployname tests" and see if it succeeds? This task runs all of Keel's unit tests, including tests on beans & persistence. It should trip up on any problem that's causing the below. If not, then the next step will be to make a test that *does* trip up, so we don't hit a problem like this again! Mike On Thu, 8 Apr 2004 13:05:58 -0700 "Calvin Smith" <[email protected]> wrote: > Hi, > > I'm just getting started with Keel, so forgive me if there are any silly > mistakes in what follows. I'm on my way to getting persistance working > with hsqldb and hibernate services, but I've run into a couple of > problems. > > First, I would like to see what hsql has in the database, and have been > trying to connect to the hsqldb that is running inside keel, but I can't > get the connect string, user, and password correct. I've tried various > ports and URLs for the two standard hsql URLs (jdbc:hsqldb:<database> > and jdbc:hsqldb:hsql://<host>:<port>, including port 9001, which I think > is the standard port, but I always get a "Connection refused" error. Can > anybody tell me what the default database url is for hsqldb in keel, or > which file this would be configured in? > > Second, and this is the underlying problem I'm having with hsql and > hibernate, it seems that I am able to add objects created from > information a user submitted, but when I retrieve an object later, it > always seems to return the same object, regardless of what I've set the > field to for the retrieve. > > I'm adding like so: > > Persistent m = pf.create("tax.ZipTaxRate"); m.setField("newZipCode", > request.getParameter("newZipCode")); > m.setField("newTaxRate", request.getParameter("newTaxRate")); > m.add(); > > And this works with no errors. For the sake of the example, let's say I > did this twice, with different zip codes and tax rates each time. > > The problem is that when I later try to retrieve an object, it always > retrieves the first object added, even when the field for the retrieve > (newZipCode, which is the key) has been set to the zip code of the > second object. > > Here is how I'm trying to retrieve the object: > > Persistent m = pf.create("tax.ZipTaxRate"); String zipCode = (String) > request.getParameter("zipCode"); m.setField("newZipCode", zipCode); // > zipCode is the value of the second object I added > m.retrieve(); > ZipRate zipRate = (ZipRate) m.getBean(); // simple bean with two fields, > newZipCode & newTaxRate > > When I do zipRate.getNewTaxRate(), I get the value for the first object, > not the object that has the key I submitted. Maybe I'm doing something > wrong here, or perhaps I'm running into some kind of cache issue. Does > this problem ring a bell for anybody? > > cheers, > > Calvin > > -- > > ThatOne Company > > http://www.thatone.com/ > > _______________________________________________ > User mailing list > [email protected] > http://lists.keelframework.org/listinfo.cgi/user-keelframework.org -- Michael Nash JGlobal Ltd Next-Generation Web Application Development and Open Source Support http://www.jglobal.com Bahamas Commerce and Trade Offshore eCommerce Hosting and Business Services http://www.bahamascommerce.com