db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Jefferson (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-263) TestArrayCollections: Field ArrayOfBigDecimal12 is stored incorrectly
Date Sat, 07 Jan 2006 07:39:14 GMT
    [ http://issues.apache.org/jira/browse/JDO-263?page=comments#action_12362045 ] 

Andy Jefferson commented on JDO-263:
------------------------------------

Craig, Michelle,
thanks for your investigation. Always nice to have new JPOX developers ;-).

I agree that the issue is of JPOX's way of storing serialised arrays - not sure what I was
thinking of earlier, must be the effects of too much alcohol over the holidays :-)

Blob2RDBMSMapping isn't actually used for BigDecimal[] storage. We use LongVarBinaryRDBMSMapping
(since Derby  uses LONGVARBINARY, as it has no BLOB type) but that was doing the same as you
observed anyway.

There are 2 ways to store an array (e.g byte[]) in a single (BLOB) column.
1. Java serialisation (where the field is tagged as "serialized"). 
2. Use a byte stream.
The latter is useful where you want to store something like a JPEG and want its datastore
representation to be just that, without the leading and trailing parts that ObjectOutputStream
includes. What was happening is that BigDecimal[] was going through the byte stream process
(and was also losing precision as you stated - retaining only DECIMAL64 precision, whereas
it required DECIMAL128) and also not actually being serialised - we've had a JPOX JIRA issue
for a month or so to allow both methods as configurable.

Storage of a BigDecimal[] as a byte stream and retaining the precision was fixed last night
by Erik.
I'll update JPOX CVS later today to use the serialisation method when the field is marked
as serialised, and byte streams otherwise.

> TestArrayCollections: Field ArrayOfBigDecimal12 is stored incorrectly
> ---------------------------------------------------------------------
>
>          Key: JDO-263
>          URL: http://issues.apache.org/jira/browse/JDO-263
>      Project: JDO
>         Type: Bug
>   Components: tck20
>     Reporter: Michelle Caisse
>     Assignee: Andy Jefferson
>  Attachments: jdo-263.patch
>
> test(org.apache.jdo.tck.models.fieldtypes.TestArrayCollections)javax.jdo.JDOUserException:
Field "org.apache.jdo.tck.pc.fieldtypes.ArrayCollections.ArrayOfObject1" is declared as a
reference type (interface/Object) but no implementation classes of "java.lang.Object" have
been found!
> 	at org.jpox.metadata.MetaDataUtils.getImplementationNamesForReferenceField(MetaDataUtils.java:594)
> 	at org.jpox.store.rdbms.table.ColumnCreator.createColumnsForReferenceField(ColumnCreator.java:184)
> 	at org.jpox.store.rdbms.table.ColumnCreator.createColumnsForField(ColumnCreator.java:296)
> 	at org.jpox.store.rdbms.table.ColumnCreator.createColumns(ColumnCreator.java:95)
> 	at org.jpox.store.rdbms.table.ArrayTable.initialize(ArrayTable.java:83)
> 	at org.jpox.store.rdbms.RDBMSManager$ClassAdder.addClassTablesAndValidate(RDBMSManager.java:2404)
> 	at org.jpox.store.rdbms.RDBMSManager$ClassAdder.run(RDBMSManager.java:2033)
> 	at org.jpox.store.rdbms.RDBMSManager$MgmtTransaction.execute(RDBMSManager.java:1893)
> 	at org.jpox.store.rdbms.RDBMSManager.addClasses(RDBMSManager.java:479)
> 	at org.jpox.store.rdbms.RDBMSManager.addClass(RDBMSManager.java:493)
> 	at org.jpox.store.rdbms.RDBMSManager.getDatastoreClass(RDBMSManager.java:766)
> 	at org.jpox.state.StateManagerImpl.populateStrategyFields(StateManagerImpl.java:781)
> 	at org.jpox.state.StateManagerImpl.<init>(StateManagerImpl.java:584)
> 	at org.jpox.AbstractPersistenceManager.internalMakePersistent(AbstractPersistenceManager.java:1076)
> 	at org.jpox.AbstractPersistenceManager.makePersistent(AbstractPersistenceManager.java:1131)
> 	at org.apache.jdo.tck.models.fieldtypes.TestArrayCollections.runTest(TestArrayCollections.java:93)
> 	at org.apache.jdo.tck.models.fieldtypes.TestArrayCollections.test(TestArrayCollections.java:69)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:204)
> 	at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:120)
> 	at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:95)

-- 
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


Mime
View raw message