Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 269789 - Support EMF BigInteger and BigDecimal data types
Summary: Support EMF BigInteger and BigDecimal data types
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: M7   Edit
Assignee: Eike Stepper CLA
QA Contact:
URL:
Whiteboard: Appealing to a Broader Community
Keywords:
Depends on: 268663
Blocks:
  Show dependency tree
 
Reported: 2009-03-24 04:49 EDT by Stephane fournier CLA
Modified: 2010-06-29 09:21 EDT (History)
3 users (show)

See Also:
stepper: galileo+
stepper: review+


Attachments
Handle BigInteger and BigDecimal as String (1.26 KB, patch)
2009-04-04 05:53 EDT, Stephane fournier CLA
no flags Details | Diff
Patch v1 (4.91 KB, patch)
2009-04-04 12:05 EDT, Simon Mc Duff CLA
no flags Details | Diff
Patch v2 - Enhance test case (2.78 KB, patch)
2009-04-26 11:58 EDT, Eike Stepper CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephane fournier CLA 2009-03-24 04:49:25 EDT
Build ID: I20090313-0100

Steps To Reproduce:
1.Use an Ecore model where attributes are mapped to EBigInteger and EBigDecimal


More information:
CDO build : 2.0.0M6

CDOModelUtil registers null for both data types.

At least, CDOType.CUSTOM can be used.
I tested that, it works fine.
Comment 1 Simon Mc Duff CLA 2009-03-31 13:39:38 EDT
I think to put it as custom will be the good fix.
Why ? BigINteger and BigDecimal are using an variable array... and I doubt it will be efficient to transfer that king of object.
We will transfer them as CUSTOM. Let me know if anybody have a better solution.

Simon
Comment 2 Eike Stepper CLA 2009-03-31 13:47:19 EDT
Transfer as String seems fine.
Comment 3 Stephane fournier CLA 2009-04-04 05:53:22 EDT
Created attachment 130913 [details]
Handle BigInteger and BigDecimal as String

Hi Eike,
CDOType.CUSTOM transfer data as String.
Please find a patch for CDOModelUtil class.

Stephane.
Comment 4 Simon Mc Duff CLA 2009-04-04 12:04:43 EDT
I created my testcase first... and it worked without applying your patch.

Since CDOStore now used CDOMOdelUtill.getType and not CDOModelUtil.getCoreType... it is working.

CDOModelUtil.getType will return CUSTOM if it doesn't find anything.
I still used your patch so it is clear that BigINteger and BigDecimal should uses CUSTOM.
But I think it should work in latest build as well.



Comment 5 Simon Mc Duff CLA 2009-04-04 12:05:04 EDT
Created attachment 130917 [details]
Patch v1
Comment 6 Eike Stepper CLA 2009-04-05 04:34:06 EDT
This one was easy :P

Ready to be committed.
Comment 7 Simon Mc Duff CLA 2009-04-05 09:12:23 EDT
Commited to HEAD
Comment 8 Eike Stepper CLA 2009-04-26 11:56:55 EDT
There seems to be some value conversion from certain EDataTypes to String (inside the revision).
Comment 9 Eike Stepper CLA 2009-04-26 11:58:07 EDT
Created attachment 133250 [details]
Patch v2 - Enhance test case
Comment 10 Eike Stepper CLA 2009-04-26 12:19:19 EDT
Added:
org.eclipse.emf.cdo.common.model.CDOType.BIG_DECIMAL
org.eclipse.emf.cdo.common.model.CDOType.BIG_INTEGER

Tests passing.
Committed to HEAD.
Comment 11 Eike Stepper CLA 2009-05-06 06:40:12 EDT
Fix available in EMF CDO 2.0.0M7
Comment 12 Stephane fournier CLA 2009-05-07 09:44:19 EDT
Hi guys,

I've just downloaded the CD0 & NET4J 2.0.0M7a.

It seems I got an issue again with BIG_INTEGER :(

Here is the stack trace :

[ERROR] Rollback in DBStore: org.eclipse.net4j.util.ImplementationError: Unrecognized CDOType: BIG_INTEGER
	at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.createValueMapping(AbstractMappingStrategy.java:443)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.createValueMappings(AbstractHorizontalClassMapping.java:117)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.initFeatures(AbstractHorizontalClassMapping.java:105)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.<init>(AbstractHorizontalClassMapping.java:74)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalAuditClassMapping.<init>(HorizontalAuditClassMapping.java:63)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalAuditMappingStrategy.doCreateClassMapping(HorizontalAuditMappingStrategy.java:29)
	at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.createClassMapping(AbstractMappingStrategy.java:355)
	at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapClasses(AbstractMappingStrategy.java:325)
	at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapPackageInfos(AbstractMappingStrategy.java:314)
	at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapPackageUnits(AbstractMappingStrategy.java:336)
	at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.createMapping(AbstractMappingStrategy.java:297)
	at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writePackageUnits(DBStoreAccessor.java:498)
	at org.eclipse.emf.cdo.spi.server.StoreAccessor.write(StoreAccessor.java:129)
	at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.access$4(DBStoreAccessor.java:1)
	at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor$1.runLoop(DBStoreAccessor.java:80)
	at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor$1.runLoop(DBStoreAccessor.java:1)
	at org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
	at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write(DBStoreAccessor.java:298)
	at org.eclipse.emf.cdo.internal.server.TransactionCommitContextImpl.write(TransactionCommitContextImpl.java:269)
	at org.eclipse.emf.cdo.internal.server.protocol.CommitTransactionIndication$1.runLoop(CommitTransactionIndication.java:73)
	at org.eclipse.emf.cdo.internal.server.protocol.CommitTransactionIndication$1.runLoop(CommitTransactionIndication.java:1)
	at org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
	at org.eclipse.emf.cdo.internal.server.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:325)
	at org.eclipse.emf.cdo.internal.server.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:198)
	at org.eclipse.emf.cdo.internal.server.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:140)
	at org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:84)
	at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:90)
	at org.eclipse.net4j.signal.Signal.doInput(Signal.java:317)
	at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:63)
	at org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:63)
	at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
	at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Comment 13 Simon Mc Duff CLA 2009-05-07 10:06:41 EDT
This is related to DBStore. We should open another bugzilla for that.
Comment 14 Stephane fournier CLA 2009-05-07 10:14:03 EDT
(In reply to comment #13)
> This is related to DBStore. We should open another bugzilla for that.
> 

I've just filed a new one : https://bugs.eclipse.org/bugs/show_bug.cgi?id=275303.
Comment 15 Eike Stepper CLA 2009-05-18 03:43:47 EDT
Fix available in CDO 2.0.0M7
Comment 16 Eike Stepper CLA 2009-06-27 11:54:14 EDT
Generally available.