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

Bug 357184

Summary: reuse Blob
Product: [Modeling] EMF Reporter: georgehill
Component: cdo.coreAssignee: Eike Stepper <stepper>
Status: CLOSED DUPLICATE QA Contact: Eike Stepper <stepper>
Severity: major    
Priority: P3    
Version: 4.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description georgehill CLA 2011-09-09 02:36:25 EDT
Build Identifier: 20110615-0604

The following code in 
CDOCommitContextImpl.preCommit() not works, as byte arrays are not equal by content, thus preventing reuse of blobs in the database

for (byte[] id : alreadyKnown) {
   lobs.remove(id);
} 


Caused by: java.sql.SQLIntegrityConstraintViolationException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'CDO_LOBS_IDX0' defined on 'CDO_LOBS'. 

Reproducible: Always

Steps to Reproduce:
1. Create a blob and commit
2. In the same eobject change an different feature
3. commit and get the error message
Comment 1 Eike Stepper CLA 2011-09-19 01:33:58 EDT
Thank you for tracking down the issue, but I noticed that it has already been fixed in bug 351067 and back ported to 4.0 in bug 351202. 4.0 SR1 is about to be rolled out. In the meantime please have a look at our maintenance builds: http://www.eclipse.org/cdo/downloads/#maintenance

*** This bug has been marked as a duplicate of bug 351202 ***
Comment 2 Eike Stepper CLA 2012-09-21 07:18:31 EDT
Closing.