Return-Path: Delivered-To: apmail-db-ojb-user-archive@www.apache.org Received: (qmail 1631 invoked from network); 20 Jun 2005 09:45:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Jun 2005 09:45:06 -0000 Received: (qmail 91959 invoked by uid 500); 20 Jun 2005 09:45:04 -0000 Delivered-To: apmail-db-ojb-user-archive@db.apache.org Received: (qmail 91940 invoked by uid 500); 20 Jun 2005 09:45:03 -0000 Mailing-List: contact ojb-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "OJB Users List" Reply-To: "OJB Users List" Delivered-To: mailing list ojb-user@db.apache.org Received: (qmail 91924 invoked by uid 99); 20 Jun 2005 09:45:03 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jun 2005 02:44:58 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [213.115.149.212] (HELO manta.curalia.se) (213.115.149.212) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jun 2005 02:44:22 -0700 Received: from manta.curalia.se (manta.curalia.se [213.115.149.212]) by manta.curalia.se (Postfix) with ESMTP id E229CABC032 for ; Mon, 20 Jun 2005 11:44:26 +0200 (CEST) Received: from [172.20.6.103] (raa-se.raa.se [193.10.40.128]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by manta.curalia.se (Postfix) with ESMTP id D1955ABC008 for ; Mon, 20 Jun 2005 11:44:26 +0200 (CEST) Message-ID: <42B6906A.2060004@apache.org> Date: Mon, 20 Jun 2005 11:46:18 +0200 From: =?ISO-8859-1?Q?Martin_Kal=E9n?= Organization: ASF User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: OJB Users List Subject: Re: primary key problem sql server References: <59f42c0005061504004dacea21@mail.gmail.com> In-Reply-To: <59f42c0005061504004dacea21@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AV-Checked: ClamAV using ClamSMTP X-Old-Spam-Check-By: apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Alessandro Colantoni wrote: > I'm using ojb 1.0.1 with sql server. > When I store an object, and then I delete it directly on the db I can't > insert it a second time. > Before storing I use to check if an object with the same key exists. > ojb doesn't detect any object with the same key (correctly... I deleted it) > But when storing it catch a sql server exception because primary key already > exists. > Is it a limit of microsoft sql server (it keeps primary key somewhere?) or > I'm doing something wrong? This sounds like a transaction isolation problem. If you use the PB API with OJB without the two-level cache you will not have any transaction isolation and a delete will be directly visible in the cache before commit. However, if you don't use auto-commit on the Connection to MSSQL the database DELETE will not be performed until COMMIT. What is your auto-commit setting in repository_database.xml and which OJB API are you using? Regards, Martin --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org For additional commands, e-mail: ojb-user-help@db.apache.org