Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 351393

Summary: [DB] Make the URI column in the table "cdo_ext_refs" larger
Product: [Modeling] EMF Reporter: Steve Monnier <steve.monnier>
Component: cdo.dbAssignee: Stefan Winkler <stefan>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: enhancement    
Priority: P3 CC: mariot.chauvin, stepper
Version: 4.1Flags: stepper: review+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: Lighter, Faster and Better
Attachments:
Description Flags
Patch-v1
none
mylyn/context/zip none

Description Steve Monnier CLA 2011-07-07 04:05:54 EDT
Build Identifier: 

Hello,

When trying to commit a newly created legacy object referencing an element in another model with an URI longer than 255 characters, I have the following exception : 

Rollback in DBStore: org.eclipse.net4j.db.DBException: org.h2.jdbc.JdbcSQLException: Value too long for column URI VARCHAR(255): ...my long uri... (284); SQL statement:
INSERT INTO cdo_external_refs(id,uri,committime) VALUES (?, ?, ?) [90005-117]

at org.eclipse.emf.cdo.server.internal.db.ExternalReferenceManager.insertNew(ExternalReferenceManager.java:252)

at org.eclipse.emf.cdo.server.internal.db.ExternalReferenceManager.mapURI(ExternalReferenceManager.java:105)

at org.eclipse.emf.cdo.server.internal.db.ExternalReferenceManager.mapExternalReference(ExternalReferenceManager.java:87)


Is there any way to customize the default mapping between URIs and column to make it use more that 255 characters ? As I'm in legacy mode, I cannot do it with annotations on my metamodel.


This bug follows this topic on the forum : http://www.eclipse.org/forums/index.php/m/693495/#msg_693495

Reproducible: Always

Steps to Reproduce:
1. commit a newly created legacy object referencing an element in another model, which is not stored in the repository, with an URI longer than 255 characters
Comment 1 Eike Stepper CLA 2011-07-07 04:24:14 EDT
Stefan, if you attach a patch for head I can merge it to 4.0 subsequently.
Comment 2 Stefan Winkler CLA 2011-07-15 05:10:34 EDT
Created attachment 199730 [details]
Patch-v1

Patch and Testcase
Comment 3 Stefan Winkler CLA 2011-07-15 05:10:37 EDT
Created attachment 199731 [details]
mylyn/context/zip
Comment 4 Eike Stepper CLA 2011-07-16 09:07:30 EDT
According to the wording of the bug title this is an enhancement.
Comment 5 Stefan Winkler CLA 2011-07-17 09:25:19 EDT
Committed to TRUNK (Revision 8718)
Comment 6 Steve Monnier CLA 2011-08-04 11:32:29 EDT
(In reply to comment #1)
> Stefan, if you attach a patch for head I can merge it to 4.0 subsequently.

Hello!

Currently, I am using version 4.0. Eike, did you have time to merge this patch to branch 4.0? Should I create another bug for version 4.0?

Thanks,
Steve
Comment 7 Eike Stepper CLA 2011-08-05 02:47:30 EDT
Back port via bug 353965.
Comment 8 Steve Monnier CLA 2011-08-05 03:57:20 EDT
(In reply to comment #7)
> Back port via bug 353965.

Thank you.
Comment 9 Eike Stepper CLA 2012-09-21 07:18:40 EDT
Closing.
Comment 10 Eike Stepper CLA 2013-01-30 00:49:14 EST
I just noticed that Bugzilla_351393_Test started to fail in all UUID scenarios, see bug 396379. The reason is that in these scenarios (client-side assigned IDs, UUIDs) external references are NOT stored in a separate table, but "in sito". That means that all CDOID columns need to have at least the length of the longest external URI!

Excluding that particular test case from UUID scenarios:
commit 8a7885b70e7d4158392fde0ab75f55080516498d