Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311985 - error in insert into a clob field
Summary: error in insert into a clob field
Status: CLOSED DUPLICATE of bug 307774
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-06 18:08 EDT by keithchen2005 CLA
Modified: 2022-06-09 10:27 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description keithchen2005 CLA 2010-05-06 18:08:15 EDT
Build Identifier: 2.0.2 official release

I attached the exception below. The insertion happens fine with eclipselink 2.0.0 and 1.1.1, but when I upgraded to 2.0.2, I got such exception. 

JPA tries to insert a row into a table. The table has a clob field (annotated as @Lob in Java class). The insertion failed when eclipselink 2.0.2 tries to insert into the clob field. I don't understand why it tries to shrink the clob field to 256 character wide.
 
by the way, I am using Derby 10.4.2.0 as underlying database. IDE is eclipse 3.4, and runs on windows xp.



Internal Exception: java.sql.SQLException: A truncation error was encountered trying to shrink CLOB 'opRun:PERMIT;opRunDef:PERMIT;opOpen:PERMIT;opList:PERMIT;opV&' to length 255.
Error Code: -1
Call: INSERT INTO UOA_PSETS (ID, PERMISSIONS, DESCRIPTION, NAME) VALUES (?, ?, ?, ?)
	bind => [10392, opRun:PERMIT;opRunDef:PERMIT;opOpen:PERMIT;opList:PERMIT;opViewProps:PERMIT;opRepSrvProps:PERMIT;opInfoAssist:PERMIT;opAGA:PERMIT;opEditor:PERMIT;opCreateFL:PERMIT;opCreateItem:PERMIT;opWrite:PERMIT;opMakeManaged:PERMIT;opMakePrivate:PERMIT;opUpdateOwnership:PERMIT;opShareItem:PERMIT;opSaveDef:PERMIT;opDelete:PERMIT;opViewRulesOn:PERMIT;, Legacy ContentManager Permissions, WF_ContentManager]
Query: InsertObjectQuery(com.ibi.ibss.dbdriver.IBSSPermissionSetDB[id=10392])
	at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:102)
	at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:63)
	at com.ibi.sqlscriptswithjpa.core.DBLoader.loadData(DBLoader.java:103)

Reproducible: Always

Steps to Reproduce:
1. create a java entity class with a lob field in it
2. try to insert a wider-than-256-char data into that field.  
3. running on a derby database. expect a sql exception of truncation error was encountered trying to shrink CLOB
Comment 1 Guy Pelletier CLA 2010-05-14 14:51:34 EDT

*** This bug has been marked as a duplicate of bug 307774 ***
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:27:27 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink