Hi, On Feb 28, 2006, at 9:40 AM, [EMAIL PROTECTED] wrote:
[ReSEnDING lost in some wire...]I'm working on the action item, and I have one question about it. JPOX willhaveto validate primary key columns, and one of the primary key fields is String. The column for the primary key in the db has 16 chars length, but in the metadata it defaults to 255 (JPOX). Spec says it should defaults to 256.1-what should the impl do: take the schema from db as valid or the metadata?
If you're generating schema, then you should figure out what the length should be from the column metadata. If you already have a database, you should not use the length or scale settings (default or not) but use the column definition in the database.
2-The most common limit for CHAR in RDBMS is 255, why is it set to 256 in thespec?
Somewhat random. Some products I looked at on the web default to 254, some to 255, and some to 1. If you think that a more rational default for your users is 255, then you can set up a property (e.g. org.jpox.generate.defaultLength=255) when doing schema generation and this would override the JDO default setting.
Craig
org.jpox.AbstractPersistenceManager.makePersistentAll (AbstractPersistenceManager.java:1217)Quoting "Michael Watzek (JIRA)" <[EMAIL PROTECTED]>:[ http://issues.apache.org/jira/browse/JDO-308?page=all ] Michael Watzek updated JDO-308: ------------------------------- Attachment: JDO-308.patchThe attached patch fixes this issue. Applying this patch, a TCK run resultsin 4 failures and 409 errors. Most of the errors are due to the sameproblem:JPOX generates SQL which inserts a value into an identity column (seebelow).Eric has an action item to investigate JPOX's ability to use nativeidentitystrategy given an identity column in the schema (see minutes Feb 17 2006).testPositive(org.apache.jdo.tck.query.sql.NewQuery) javax.jdo.JDOUserException:133)One or more instances could not be made persistent atorg.apache.jdo.tck.query.QueryTest.loadAndPersistCompanyModel (QueryTest.java:201)org.apache.jdo.tck.query.QueryTest.makePersistentAll (QueryTest.java:225)atat(DATASTORE_IDENTITY,ID,FOUNDEDDATE,"NAME",ADDRID,CITY,COUNTRY,"STATE", STREET,ZIPCODE)at org.apache.jdo.tck.query.sql.NewQuery.localSetUp (NewQuery.java:87)at org.apache.jdo.tck.JDO_Test.setUp(JDO_Test.java:187) at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:203)at org.apache.jdo.tck.util.BatchTestRunner.start (BatchTestRunner.java:120) at org.apache.jdo.tck.util.BatchTestRunner.main (BatchTestRunner.java:95)NestedThrowablesStackTrace: javax.jdo.JDODataStoreException: Insert request failed: INSERT INTO datastoreidentity0.COMPANIESorg.jpox.state.StateManagerImpl.internalMakePersistent (StateManagerImpl.java:3310)VALUES (?,?,?,?,?,?,?,?,?,?) atorg.jpox.store.rdbms.request.InsertRequest.execute (InsertRequest.java:338) at org.jpox.store.rdbms.table.ClassTable.insert(ClassTable.java: 2110)at org.jpox.store.StoreManager.insert(StoreManager.java:735) atorg.jpox.AbstractPersistenceManager.internalMakePersistent (AbstractPersistenceManager.java:1112)atorg.jpox.state.StateManagerImpl.makePersistent (StateManagerImpl.java:3283)atorg.jpox.AbstractPersistenceManager.makePersistent (AbstractPersistenceManager.java:1167)atorg.jpox.AbstractPersistenceManager.makePersistentAll (AbstractPersistenceManager.java:1207)atorg.apache.jdo.tck.query.QueryTest.loadAndPersistCompanyModel (QueryTest.java:201)org.apache.jdo.tck.query.QueryTest.makePersistentAll (QueryTest.java:225)atatorg.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepar eInternalStatement(Unknownat org.apache.jdo.tck.query.sql.NewQuery.localSetUp (NewQuery.java:87)org.apache.derby.impl.sql.compile.ResultColumnList.checkAutoincrement (Unknownat org.apache.jdo.tck.JDO_Test.setUp(JDO_Test.java:187) at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:203)at org.apache.jdo.tck.util.BatchTestRunner.start (BatchTestRunner.java:120) at org.apache.jdo.tck.util.BatchTestRunner.main (BatchTestRunner.java:95)NestedThrowablesStackTrace:ERROR 42Z23: Attempt to modify an identity column 'DATASTORE_IDENTITY'. at org.apache.derby.iapi.error.StandardException.newException (UnknownSource) atSource)at org.apache.derby.impl.sql.compile.InsertNode.bind(Unknown Source) at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source) at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)atcom.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement (NewProxyConnection.java:190)Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(UnknownSource)at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init> (UnknownSource)at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init> (UnknownSource) at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(UnknownSource)at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement (UnknownSource)at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement (UnknownSource) atorg.jpox.state.StateManagerImpl.internalMakePersistent (StateManagerImpl.java:3310)at org.jpox.store.rdbms.RDBMSManager.getStatement (RDBMSManager.java:359) at org.jpox.store.rdbms.RDBMSManager.getStatement (RDBMSManager.java:316)atorg.jpox.store.rdbms.request.InsertRequest.execute (InsertRequest.java:181) at org.jpox.store.rdbms.table.ClassTable.insert(ClassTable.java: 2110)at org.jpox.store.StoreManager.insert(StoreManager.java:735) atorg.jpox.AbstractPersistenceManager.internalMakePersistent (AbstractPersistenceManager.java:1112)atorg.jpox.state.StateManagerImpl.makePersistent (StateManagerImpl.java:3283)atorg.jpox.AbstractPersistenceManager.makePersistent (AbstractPersistenceManager.java:1167)atorg.jpox.AbstractPersistenceManager.makePersistentAll (AbstractPersistenceManager.java:1207)atorg.apache.jdo.tck.query.QueryTest.loadAndPersistCompanyModel (QueryTest.java:201)org.apache.jdo.tck.query.QueryTest.makePersistentAll (QueryTest.java:225)atatat org.apache.jdo.tck.query.sql.NewQuery.localSetUp (NewQuery.java:87)at org.apache.jdo.tck.JDO_Test.setUp(JDO_Test.java:187) at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:203)at org.apache.jdo.tck.util.BatchTestRunner.start (BatchTestRunner.java:120) at org.apache.jdo.tck.util.BatchTestRunner.main (BatchTestRunner.java:95)Remove attribute strategy from elements datastore-identity in ORM files ------------------------------------------------------------------- ----Key: JDO-308 URL: http://issues.apache.org/jira/browse/JDO-308 Project: JDO Type: Bug Components: tck20 Versions: JDO 2 beta Reporter: Michael Watzek Assignee: Michael Watzek Priority: Minor Fix For: JDO 2 final Attachments: JDO-308.patchWe decided to remove attribute strategy rom elements datastore- identityinORM files. Thus, default strategy "native" will apply. The rationale is to also support JDO implementations, which only support datastore identity and which only runs on a RDBMS that has sequences and no identity columns.-- This message is automatically generated by JIRA. -If you think it was sent incorrectly contact one of the administrators:http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
Craig Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:[EMAIL PROTECTED] P.S. A good JDO? O, Gasp!
smime.p7s
Description: S/MIME cryptographic signature
