Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 1492 invoked from network); 24 Sep 2006 16:08:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Sep 2006 16:08:21 -0000 Received: (qmail 58747 invoked by uid 500); 24 Sep 2006 16:08:21 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 58356 invoked by uid 500); 24 Sep 2006 16:08:20 -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 58334 invoked by uid 99); 24 Sep 2006 16:08:20 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Sep 2006 09:08:20 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=dinis@mentesvirtuais.com; spf=permerror X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=HTML_MESSAGE Received-SPF: error (idunn.apache.osuosl.org: domain mentesvirtuais.com from 84.90.25.158 cause and error) Received: from [84.90.25.158] ([84.90.25.158:64465] helo=mail.pimpao.com) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id CB/40-10787-F6DA6154 for ; Sun, 24 Sep 2006 09:08:17 -0700 Received: from dinislaptop ([10.8.0.6]) by mail.pimpao.com (8.12.8/8.12.8) with ESMTP id k8OFr6Da000785 for ; Sun, 24 Sep 2006 16:53:06 +0100 From: "Pedro Dinis" To: "'Derby Discussion'" Subject: reset SM_ID value Date: Sun, 24 Sep 2006 17:08:16 +0100 Message-ID: <000c01c6dff3$a5a0bea0$0600080a@dinislaptop> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000D_01C6DFFC.076526A0" X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 Thread-Index: Acbf86URrl6U9I3sT7qfDMzM7vCAGw== X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_000D_01C6DFFC.076526A0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I've a table which has lots of inserts and deletes (400 inserts/second) and where primary key is something like this: CREATE TABLE WORK2 ( SM_ID INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), MID VARCHAR(32), (.) ); With this kind of primary key definition I know that will be a time when the column SM_ID will reach the maximum value that a Java int value can have- 2147483647 (java.lang.Integer.MAX_VALUE) . So how can I resolve this problem? I know that this table , WORK2, from time to time will be totally empty, so my first idea was to reset the counter that SM_ID column is using back to 1 when the table has no lines. This way, next new line to be inserted on WORK2 will have SM_ID = 1.. But I don't know how to do this via JDBC. Many thanks, P.Dinis. ------=_NextPart_000_000D_01C6DFFC.076526A0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I’ve a table which has lots of inserts and = deletes (400 inserts/second) and  where primary key is something  like = this:

 

CREATE TABLE  WORK2 = (

SM_ID INT NOT NULL GENERATED ALWAYS AS IDENTITY = (START WITH 1, INCREMENT BY 1),

MID VARCHAR(32),

(…)

);

 

With this kind of primary key definition I know that = will be a time when the column SM_ID will reach the maximum value that a Java = int value  can have- 2147483647 (java.lang.Integer.MAX_VALUE) .

So how can I resolve this problem?

 

I know that this table , WORK2, from time to time will be = totally empty, so my first  idea was to reset the counter that SM_ID column is = using back to 1 when the table has no lines. This way, next new line to be inserted = on WORK2 will have SM_ID =3D 1…. But I don’t know how to do = this via JDBC.

 

Many thanks,

P.Dinis.

 

 

=

 

 

 

------=_NextPart_000_000D_01C6DFFC.076526A0--