Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 33383 invoked from network); 16 Sep 2005 02:41:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Sep 2005 02:41:17 -0000 Received: (qmail 15961 invoked by uid 500); 16 Sep 2005 02:41:17 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 15942 invoked by uid 99); 16 Sep 2005 02:41:17 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Sep 2005 19:41:17 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of karan.malhi@gmail.com designates 64.233.162.207 as permitted sender) Received: from [64.233.162.207] (HELO zproxy.gmail.com) (64.233.162.207) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Sep 2005 19:41:27 -0700 Received: by zproxy.gmail.com with SMTP id 9so14260nzo for ; Thu, 15 Sep 2005 19:41:16 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=Of9llpDV5VkqFvpYOUw7Rfc7YeF3EyzvI2JuIrFX3ZaUFB8xI07nNg1d4Fs0iF8SVujHC52lnmufW+jmzBxssQy/n3TkNmcpHHHEOPgBZGNoRCnu2wX/bomkzJWucNOfCAqKzHYbHXrLVzA8ToVQ87KKlVMCXDwQ9oGpWWG9+2Y= Received: by 10.54.114.10 with SMTP id m10mr34040wrc; Thu, 15 Sep 2005 19:41:16 -0700 (PDT) Received: from ?192.168.1.3? ( [70.104.84.241]) by mx.gmail.com with ESMTP id 29sm1726895wrl.2005.09.15.19.41.14; Thu, 15 Sep 2005 19:41:15 -0700 (PDT) Message-ID: <432A3060.8040809@gmail.com> Date: Thu, 15 Sep 2005 22:39:28 -0400 From: karan malhi User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: jdo-dev@db.apache.org Subject: Re: jpox cannot find sequence References: <432A26B3.4030305@gmail.com> <7E4AEA86-1079-4386-8A3D-01B869735690@Sun.COM> In-Reply-To: <7E4AEA86-1079-4386-8A3D-01B869735690@Sun.COM> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Sorry Craig, I now understand what you are saying about factory sequences. I misunderstood the concept earlier. Craig Russell wrote: > Hi Karan, > > You might not have noticed my question earlier today regarding Derby > and sequences, and the reply. > > Derby does not support sequences. So the only sequence that you will > be able to use is a hand-written sequence or replace Derby by another > database, e.g. SQLServer. > > I think the expert group has some work to do before sequences are > specified well enough to be tested. But we can still flesh out the > test strategy even though we can't test them. > > For example, we will want to test the behavior of nontransactional and > transactional sequences. We will need two threads to test > transactional sequences. Each thread will ask for the next object from > the same sequence, and we should make sure that these threads are > serialized. > > There is not much if any testable behavior for noncontiguous > sequences, except to get some number of next object and make sure that > there are no duplicates. For contiguous sequences, make sure that the > numbers of next objects are continuously increasing. Mix the next and > nextValue methods and make sure that the numbers continuously increase. > > For nontransactional sequences, start multiple threads and make sure > that they don't interfere with each other (using a barrier might work > here). Nontransactional sequences should not block, but only serialize > through the "increment" part of the code. > > Craig > > On Sep 15, 2005, at 6:58 PM, karan malhi wrote: > >> Hi , >> >> I am trying to call >> pm.getSequence("org.apache.jdo.tck.pc.company.TestSequence") and i >> get a JDOUserException that jpox is unable to find the sequence. >> Has anybody successfully obtained a sequence with jpox before? >> Can anybody guide me as to what am i missing in writing this test >> case. If you dont find anything wrong with it, then should i assume >> that this test fails and jpox does not support sequence . >> Has anybody tried any of the tests with mysql (we will have to run >> against some db to test native datastore sequence since derby doesnt >> support them) >> >> HERE IS MY .CONF FILE >> >> jdo.tck.description = Run one test for debugging >> jdo.tck.testdata = >> jdo.tck.standarddata = >> jdo.tck.mapping = 0 >> jdo.tck.classes = org.apache.jdo.tck.api.persistencemanager.Test >> >> HERE IS PART OF MY package-derby.orm FILE >> >> >> >> >> >> >> TEST.JAVA (I am just trying to get a sequence) >> >> public void test() { >> pm = getPM(); >> Transaction tx = pm.currentTransaction(); >> tx.begin(); >> try{ >> Sequence seq = >> pm.getSequence("org.apache.jdo.tck.pc.company.TestSequence"); >> }catch(JDOUserException e){ >> fail(ASSERTION_FAILED, >> "Could not get sequence "+e.getMessage().toUpperCase()); >> } >> >> >> tx.commit(); >> pm.close(); >> pm = null; >> } >> >> MAVEN COMMAND >> >> maven -bo -Djdo.tck.cfglist=aaa.conf >> -Djdo.tck.identitytypes=applicationidentity runtck.jdori >> >> >> ERROR >> >> doRuntck.jdori: >> [java] RUN Test.test 21:43:10,140 (main) DEBUG >> [JPOX.RDBMS.SCHEMA] - Database adapter allows schemas to be used in >> table definitions >> [java] 21:43:10,140 (main) INFO [JPOX.RDBMS] - RDBMS Adapter >> initialised : CloudscapeAdapter : Apache Derby version=10.1.1.0, >> major=10, minor=1, revision=1 >> [java] Identifier Names : UPPERCASE >> [java] Driver name=Apache Derby Embedded JDBC Driver, >> version=10.1.1.0, major=10, minor=1 >> [java] Identifier Max Lengths : Table=128 Column=30 >> Constraint=18 Index=18 Delimeters=" >> [java] Identifier Support in DDL : catalog=false schema=true >> [java] 21:43:10,140 (main) INFO [JPOX.RDBMS.SCHEMA] - >> Initialising Catalog "", Schema "TCKUSER" using "None" auto-start option >> [java] 21:43:10,156 (main) INFO [JPOX.RDBMS.SCHEMA] - Catalog "", >> Schema "TCKUSER" initialised - managing 0 classes >> [java] FAILURE >> [java] Description: Run one test for debugging >> [java] Time: 002 >> [java] There was 1 failure: >> [java] 1) >> test(org.apache.jdo.tck.api.persistencemanager.Test)junit.framework.AssertionFailedError: >> Assertion A12.14-1 (Test) failed: >> [java] Could not get sequence THE REQUESTED SEQUENCE >> "ORG.APACHE.JDO.TCK.PC.COMPANY.TESTSEQUENCE" COULD NOT BE FOUND. >> PLEASE MAKE SURE THAT IT IS SPECIFIED IN A VALID META-DATA FILE. >> [java] at org.apache.jdo.tck.JDO_Test.fail(JDO_Test.java:546) >> [java] at >> org.apache.jdo.tck.api.persistencemanager.Test.test(Test.java:69) >> [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native >> Method) >> [java] at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> [java] at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> [java] at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:204) >> [java] at >> org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:115) >> [java] at >> org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:93) >> [java] FAILURES!!! >> [java] derby-app-aaa-junit.txt: >> [java] ** Tests run: 001, Time: 002 seconds. Failures: 1, >> Errors: 0 >> [java] Excluded tests: >> [org.apache.jdo.tck.enhancement.FieldAccessModified, >> org.apache.jdo.tck.enhancement.ImplementsPersistenceCapable] >> [java] [ERROR] Java Result: 1 >> [echo] Finished run with database="derby" >> identitytype="applicationidentity" mapping="". >> >> >> -- >> Karan Singh >> >> > > Craig Russell > > Architect, Sun Java Enterprise System http://java.sun.com/products/jdo > > 408 276-5638 mailto:Craig.Russell@sun.com > > P.S. A good JDO? O, Gasp! > > -- Karan Singh