logo       


setting nanos on a timestamp, sequence persistence: msg#00004

Subject: setting nanos on a timestamp, sequence persistence
Hi,

I've been tracking a bug in my code for the past couple days, and I think I've finally traced it back to some unexpected behaviour(at least for me) in hsqldb. I would insert some data including a Timestamp into a table. After that, I could extract the same data using a SELECT over a large portion of the columns. However, if I extracted the data and reconstructed the object that I used to populate the fields, I couldn't match it with the same SELECT that had previously worked. In the end I determined that in reconstructing the object, I was using setNanos on the Timestamp object returned by hsqldb. For some reason unknown to me, this also updated the timestamp in the actual table. I assumed that since the ResultSet I got wasn't updateable, any changes I made wouldn't be reflected in the database. Are my assumptions correct, or am I missing something?

Also, I'm having a little trouble using sequences. On my initial use of them, everything is kosher. They increment as I'd expect. When I exit my app and restart, weird things happen. The sequence still exists as I get a SQLException saying as much when I try to create it, but the call for next value returns 0. Is there some way to get the sequence to store its last value on the disk between invocations?

Thanks,
Charlie Groves


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn


Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, windows, cisco ...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe