Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 24985 invoked from network); 16 Sep 2005 02:12:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Sep 2005 02:12:39 -0000 Received: (qmail 87908 invoked by uid 500); 16 Sep 2005 02:12:39 -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 87895 invoked by uid 99); 16 Sep 2005 02:12:39 -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:12:39 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.18.98.34] (HELO brmea-mail-3.sun.com) (192.18.98.34) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Sep 2005 19:12:49 -0700 Received: from fe3.sun.com (fe3.Sun.COM [192.18.108.80] (may be forged)) by brmea-mail-3.sun.com (8.12.10/8.12.9) with ESMTP id j8G2Cb1L005978 for ; Thu, 15 Sep 2005 20:12:37 -0600 (MDT) Received: from conversion-daemon.fe3.sun.com by fe3.sun.com (Sun Java System Messaging Server 6.1 HotFix 0.02 (built Aug 25 2004)) id <0IMW005010CMMF00@fe3.sun.com> (original mail from Craig.Russell@Sun.COM) for jdo-dev@db.apache.org; Thu, 15 Sep 2005 20:12:37 -0600 (MDT) Received: from [192.168.0.10] ([24.6.172.77]) by fe3.sun.com (Sun Java System Messaging Server 6.1 HotFix 0.02 (built Aug 25 2004)) with ESMTPSA id <0IMW00MPO0T0BT86@fe3.sun.com> for jdo-dev@db.apache.org; Thu, 15 Sep 2005 20:12:37 -0600 (MDT) Date: Thu, 15 Sep 2005 19:12:32 -0700 From: Craig Russell Subject: Re: jpox cannot find sequence In-reply-to: <432A26B3.4030305@gmail.com> To: jdo-dev@db.apache.org Message-id: <7E4AEA86-1079-4386-8A3D-01B869735690@Sun.COM> MIME-version: 1.0 X-Mailer: Apple Mail (2.734) Content-type: multipart/signed; protocol="application/pkcs7-signature"; boundary=Apple-Mail-340-353181937; micalg=sha1 References: <432A26B3.4030305@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --Apple-Mail-340-353181937 Content-Type: multipart/alternative; boundary=Apple-Mail-339-353181162 --Apple-Mail-339-353181162 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed 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! --Apple-Mail-339-353181162 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1 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 =3D Run one test for = debugging
jdo.tck.testdata =3D
jdo.tck.standarddata =3D
jdo.tck.mapping =3D 0

HERE IS = PART OF MY package-derby.orm FILE

<orm>
=A0=A0 = <package name=3D"org.apache.jdo.tck.pc.company">
=A0 =A0 = <sequence name=3D"TestSequence"=A0 = strategy=3D"contiguous"/>
=A0=A0 =A0 =A0 <class = name=3D"Company" table=3D"companies">

TEST.JAVA (I = am just trying to get a sequence)

=A0=A0 public void test() = {
=A0=A0 =A0 = =A0 pm =3D getPM();
=A0=A0 =A0 =A0 Transaction tx =3D = pm.currentTransaction();
=A0=A0 =A0 =A0 = tx.begin();
=A0=A0 =A0 =A0 try{
=A0=A0 =A0 =A0 = Sequence seq =3D = pm.getSequence("org.apache.jdo.tck.pc.company.TestSequence");
=A0=A0 =A0 =A0 = }catch(JDOUserException e){
=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= fail(ASSERTION_FAILED,
=A0=A0 =A0 =A0 =A0 =A0 "Could not = get sequence "+e.getMessage().toUpperCase());
=A0=A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 }


=A0=A0 =A0 =A0 = tx.commit();
=A0=A0 =A0 =A0 = pm.close();
=A0=A0 =A0 =A0 pm =3D = null;
=A0=A0 =A0 =A0 }

MAVEN = COMMAND

maven -bo -Djdo.tck.cfglist=3Daaa.conf = -Djdo.tck.identitytypes=3Dapplicationidentity runtck.jdori



doRuntck.jdori:
=A0=A0 [java] RUN Test.test=A0 =A0 =A0 =A0 21:43:10,140 = (main) DEBUG [JPOX.RDBMS.SCHEMA] - Database adapter allows schemas to be = used in table definitions
=A0=A0 [java] 21:43:10,140 (main) = INFO=A0 [JPOX.RDBMS] - = RDBMS Adapter initialised : CloudscapeAdapter : Apache Derby = version=3D10.1.1.0, major=3D10, minor=3D1, revision=3D1
=A0=A0 = [java] Identifier Names : UPPERCASE
=A0=A0 [java] Driver name=3DApache = Derby Embedded JDBC Driver, version=3D10.1.1.0, major=3D10, = minor=3D1
=A0=A0 [java] Identifier Max = Lengths : Table=3D128=A0 = Column=3D30=A0 = Constraint=3D18=A0 = Index=3D18=A0 = Delimeters=3D"
=A0=A0 [java] Identifier Support = in DDL : catalog=3Dfalse=A0 = schema=3Dtrue
=A0=A0 [java] 21:43:10,140 (main) = INFO=A0 [JPOX.RDBMS.SCHEMA] = - Initialising Catalog "", Schema "TCKUSER" using "None" auto-start = option
=A0=A0 [java] 21:43:10,156 (main) = INFO=A0 [JPOX.RDBMS.SCHEMA] = - Catalog "", Schema "TCKUSER" initialised - managing 0 = classes
=A0=A0 [java]=A0 =A0 FAILURE
=A0=A0 = [java] Description: Run one test for debugging
=A0=A0 = [java] Time: 002
=A0=A0 [java] There was 1 = failure:
=A0=A0 [java] 1) = test(org.apache.jdo.tck.api.persistencemanager.Test)junit.framework.Assert= ionFailedError: Assertion A12.14-1 (Test) failed:
=A0=A0 = [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.
=A0=A0 = [java]=A0 =A0 =A0 at = org.apache.jdo.tck.JDO_Test.fail(JDO_Test.java:546)
=A0=A0 = [java]=A0 =A0 =A0 at = org.apache.jdo.tck.api.persistencemanager.Test.test(Test.java:69)
=A0=A0 = [java]=A0 =A0 =A0 at = sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
=A0=A0 = [java]=A0 =A0 =A0 at = sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:= 39)
=A0=A0 [java]=A0 =A0 =A0 at = sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm= pl.java:25)
=A0=A0 [java]=A0 =A0 =A0 at = org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:204)
=A0=A0 = [java]=A0 =A0 =A0 at = org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:115)
=A0=A0 = [java]=A0 =A0 =A0 at = org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:93)
=A0=A0 = [java] FAILURES!!!
=A0=A0 [java] = derby-app-aaa-junit.txt:
=A0=A0 [java] =A0 =A0 ** Tests run: 001, Time: = 002 seconds. Failures: 1, Errors: 0
=A0=A0 [java] Excluded tests: = [org.apache.jdo.tck.enhancement.FieldAccessModified, = org.apache.jdo.tck.enhancement.ImplementsPersistenceCapable]
=A0=A0 = [java] [ERROR] Java Result: 1
=A0=A0 [echo] Finished run with = database=3D"derby" identitytype=3D"applicationidentity" = mapping=3D"".


--=A0
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!


= --Apple-Mail-339-353181162-- --Apple-Mail-340-353181937 Content-Transfer-Encoding: base64 Content-Type: application/pkcs7-signature; name=smime.p7s Content-Disposition: attachment; filename=smime.p7s MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGHjCCAtcw ggJAoAMCAQICAw3FWTANBgkqhkiG9w0BAQQFADBiMQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhh d3RlIENvbnN1bHRpbmcgKFB0eSkgTH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