Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 19638 invoked from network); 28 Sep 2009 12:14:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Sep 2009 12:14:07 -0000 Received: (qmail 32226 invoked by uid 500); 28 Sep 2009 12:14:07 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 32161 invoked by uid 500); 28 Sep 2009 12:14:07 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 32153 invoked by uid 99); 28 Sep 2009 12:14:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Sep 2009 12:14:07 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [82.195.46.59] (HELO smtp01.equens.com) (82.195.46.59) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Sep 2009 12:13:56 +0000 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5 Subject: AW: Information for derby-user@db.apache.org Date: Mon, 28 Sep 2009 13:11:27 +0200 Message-ID: <0773A3CE9DAC7B42B8F564C52805678D024B6877@EVS01.INTERN.INTERPAY.NL> In-Reply-To: <1254134840.63988.ezmlm@db.apache.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Information for derby-user@db.apache.org Thread-Index: AcpAKSEZ7kzvOYoIRUSf84Trndz2dgAAvQxQ References: <1254134840.63988.ezmlm@db.apache.org> From: To: X-OriginalArrivalTime: 28 Sep 2009 11:11:28.0710 (UTC) FILETIME=[6D210660:01CA402C] X-Virus-Checked: Checked by ClamAV on apache.org Hi, I have a little routine, that is supposed to delete some records after a certain due date. It looks like the following: =20 public void reorganize(long defermentPeriod) { =20 m_strBuf.delete(0, m_strBuf.length()); =20 m_strBuf.append("delete from MEMO_RECORDS").append("\n") .append("where TMPST_USED >=3D ?"); =20 PreparedStatement pStmtRecord =3D null; try { pStmtRecord =3D m_conn.prepareStatement(m_strBuf.toString()); =20 long dueDate =3D new java.util.Date().getTime()+defermentPeriod; pStmtRecord.setTimestamp(1, new Timestamp(dueDate)); =20 pStmtRecord.execute(); =20 SimpleDateFormat dForm =3D new SimpleDateFormat("dd.MM.yyyy-HH:mm:ss:SSS"); logger.debug("cut off date:"+dForm.format(new Date(dueDate))); if (pStmtRecord.getUpdateCount()>0) { logger.info("deleted records by reorganisation:"+pStmtRecord.getUpdateCount()); } } catch (SQLException sqlEx) { throw new RuntimeException(sqlEx); } finally { try { pStmtRecord.close(); } catch (Throwable th) { logger.trace("trouble closing pStmtQRecord!",th); } } =20 } =20 =20 Unfortunately it does not quite that I expect. It seems that it does not really fined the records, even though the timestamps I give to this routine should give me all the records that are in the data base. The type of that column on this table is of course also a timestamp. What am I doing wrong here, or is it a bug in Derby? =20 Thanks a lot in advance for helpful replies Malte Kempff