Return-Path: Delivered-To: apmail-db-ojb-user-archive@www.apache.org Received: (qmail 43627 invoked from network); 14 Jun 2005 07:38:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Jun 2005 07:38:41 -0000 Received: (qmail 52463 invoked by uid 500); 14 Jun 2005 07:38:37 -0000 Delivered-To: apmail-db-ojb-user-archive@db.apache.org Received: (qmail 52432 invoked by uid 500); 14 Jun 2005 07:38:37 -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 52417 invoked by uid 99); 14 Jun 2005 07:38:37 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from ip-195-159-104-152.anlai.com (HELO amd.goodwillheater.com) (152.104.159.195) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 14 Jun 2005 00:38:35 -0700 Received: from sony ([192.168.10.199]) (authenticated bits=0) by amd.goodwillheater.com (8.12.11/8.12.11) with ESMTP id j5E7fdRB002176 for ; Tue, 14 Jun 2005 15:41:41 +0800 Message-ID: <031501c570b4$06b18a90$c70aa8c0@sony> From: "Johnson" To: "OJB Users List" References: <02aa01c57079$78fe90b0$c70aa8c0@sony> <42AE87C2.10905@apache.org> Subject: Re: org.odmg.LockNotGrantedException Date: Tue, 14 Jun 2005 15:38:13 +0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="big5"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-Virus-Scanned: ClamAV 0.85.1/937/Tue Jun 14 05:46:03 2005 on amd.goodwillheater.com X-Virus-Status: Clean X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi! tks your help I use OJB in cocoon tmocat here's the code. this code is work on 1.0.1 but not work in 1.0.3. public int save(Sa1 bean, Implementation impl) { int cnt = 0; Database db = impl.newDatabase(); try { db.open("sy", Database.OPEN_READ_WRITE); Transaction tx = impl.newTransaction(); tx.begin(); OQLQuery query = impl.newOQLQuery(); query.create("select sa1s from " + Sa1.class.getName() + " where sa1_ord = $1"); query.bind(bean.getSa1_ord()); DList result = (DList) query.execute(); cnt = result.size(); if (cnt != 0) { Sa1 toBeEdited = (Sa1) result.get(0); if (toBeEdited != null) { try { PropertyUtils.copyProperties(toBeEdited,bean); tx.commit(); } catch (Throwable t) {} tx.begin(); tx.lock(toBeEdited, Transaction.UPGRADE); tx.commit(); } else {tx.abort();} } else { try { tx.lock(bean, Transaction.WRITE); tx.commit(); }catch (Throwable t) {} } db.close(); } catch (ODMGException ex) {} return cnt; } Best Regards ----- Original Message ----- From: "Armin Waibel" To: "OJB Users List" Sent: Tuesday, June 14, 2005 3:31 PM Subject: Re: org.odmg.LockNotGrantedException > Hi Johnson, > > could you please post some (pseudo) code so that I can write a test to > reproduce your locking problem. Is OJB running in a managed (e.g. using > an appServer with JTA) or non-managed environment. > >> If I use another session to read it ok,But the record I wrote never >> change. > > sounds as the record was not committed. > > regards, > Armin > > > Johnson wrote: >> Hi! >> >> I try to upgrade my ojb in cocoon from 1.0.1 to 1.0.3. >> when I save a record and then read the record(or others) the system got >> an error >> org.odmg.LockNotGrantedException >> If I use another session to read it ok,But the record I wrote never >> change. >> the objectcache I use in 1.0.1 is >> org.apache.ojb.broker.cache.ObjectCachePerBrokerImpl >> and 1.0.3 I use the same or ObjectCacheTwoLevelImpl it read ok then write >> no error(but database no record) and then read again and got the error. >> is there something I'm wrong? >> >> Best Regards >> >> Johnson > > --------------------------------------------------------------------- > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org > For additional commands, e-mail: ojb-user-help@db.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org For additional commands, e-mail: ojb-user-help@db.apache.org