Hi Erik, On Feb 27, 2006, at 1:41 PM, [EMAIL PROTECTED] wrote:
I'm working on the action item, and I have one question about it. JPOX will have to 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 schema, you should not use the length or scale settings (default or not).
2-The most common limit for CHAR in RDBMS is 255, why is it set to 256 in thespec?
I thought it to be arbitrary. There wasn't a whole lot of thought to the setting. Feel free to apply a JPOX-specific default to the length (using a JPOX property). It might be too late to change the spec, but I'll take this as an action item.
Craig
Quoting "Michael Watzek (JIRA)" <[EMAIL PROTECTED]>:org.jpox.AbstractPersistenceManager.makePersistentAll (AbstractPersistenceManager.java:1217)[ 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 results in 4 failures and 409 errors. Most of the errors are due to the same problem: JPOX generates SQL which inserts a value into an identity column (see below). Eric has an action item to investigate JPOX's ability to use native identity strategy given an identity column in the schema (see minutes Feb 17 2006).133)testPositive(org.apache.jdo.tck.query.sql.NewQuery) javax.jdo.JDOUserException:One or more instances could not be made persistent atat org.apache.jdo.tck.query.QueryTest.makePersistentAll (QueryTest.java:225)org.apache.jdo.tck.query.QueryTest.loadAndPersistCompanyModel (QueryTest.java:201)atat org.apache.jdo.tck.query.sql.NewQuery.localSetUp(NewQuery.java: 87)(DATASTORE_IDENTITY,ID,FOUNDEDDATE,"NAME",ADDRID,CITY,COUNTRY,"STATE", STREET,ZIPCODE)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)atat org.apache.jdo.tck.query.QueryTest.makePersistentAll (QueryTest.java:225)org.apache.jdo.tck.query.QueryTest.loadAndPersistCompanyModel (QueryTest.java:201)atat org.apache.jdo.tck.query.sql.NewQuery.localSetUp(NewQuery.java: 87)org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepar eInternalStatement(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) atorg.apache.derby.impl.sql.compile.ResultColumnList.checkAutoincrement (UnknownSource) 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> (Unknown Source) 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 (Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement (UnknownSource)at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement (UnknownSource) atat org.jpox.store.rdbms.RDBMSManager.getStatement (RDBMSManager.java:359) at org.jpox.store.rdbms.RDBMSManager.getStatement (RDBMSManager.java:316)org.jpox.state.StateManagerImpl.internalMakePersistent (StateManagerImpl.java:3310)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)atat org.apache.jdo.tck.query.QueryTest.makePersistentAll (QueryTest.java:225)org.apache.jdo.tck.query.QueryTest.loadAndPersistCompanyModel (QueryTest.java:201)atat 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 -------------------------------------------------------------------- ---ORM 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.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- identity in-- 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
