Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » CLOB lenght problme on different databases
CLOB lenght problme on different databases [message #506367] Thu, 07 January 2010 05:25 Go to next message
Patrick Haun is currently offline Patrick HaunFriend
Messages: 30
Registered: October 2009
Member
Hi,

I use a CLOB column to store a large text in the database.

I work with a test string which contains 500000 characters.

Define that column like this:
@Lob
@Basic(fetch = FetchType.LAZY)
@Column(name = "DSGN_CNTNT", columnDefinition = "CLOB(600000)")

works with DB2 and Derby


Define that column like this:
@Lob
@Basic(fetch = FetchType.LAZY)
@Column(name = "DSGN_CNTNT")

works with pgsql and oracle



Is there a nice solution for this problem?

[Updated on: Thu, 07 January 2010 10:27]

Report message to a moderator

Re: CLOB lenght problme on different databases [message #506670 is a reply to message #506367] Fri, 08 January 2010 15:57 Go to previous messageGo to next message
Patrick Haun is currently offline Patrick HaunFriend
Messages: 30
Registered: October 2009
Member
I've found a solution using a DescriptorCustomizer. I hope this will get better with future eclipselink versions.
Re: CLOB lenght problme on different databases [message #506844 is a reply to message #506670] Mon, 11 January 2010 01:00 Go to previous messageGo to next message
Dies Koper is currently offline Dies KoperFriend
Messages: 4
Registered: July 2009
Junior Member
Does the following not work?

@Lob
@Basic(fetch = FetchType.LAZY)
@Column(name = "DSGN_CNTNT", length = 600000)

Regards,
Dies
Re: CLOB lenght problme on different databases [message #506856 is a reply to message #506367] Mon, 11 January 2010 07:03 Go to previous messageGo to next message
Patrick Haun is currently offline Patrick HaunFriend
Messages: 30
Registered: October 2009
Member
No, it doesn't.
Re: CLOB lenght problme on different databases [message #506976 is a reply to message #506367] Mon, 11 January 2010 15:28 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Why doesn't it? What error do you get? This should work.

The issue seems to be that some database require a size for CLOB, and some don't. We changed the default size for Derby to be the max clob size, so it should work now if you do not set the size.

For DB2 we are currently defaulting the size to 64,000. We should probably default it to be larger, or the DB2 max. Also the same limit is currently used for MySQL. Please log a bug to have the default sizes increased.



James : Wiki : Book : Blog : Twitter
Re: CLOB lenght problme on different databases [message #507093 is a reply to message #506367] Tue, 12 January 2010 07:40 Go to previous messageGo to next message
Patrick Haun is currently offline Patrick HaunFriend
Messages: 30
Registered: October 2009
Member
I'm currently working with 1.1.3 and there is no way to change that.
With which version should I work?

The DB2 jdbc driver throws an exception if you try to insert data which is larger than the max size.

Re: CLOB lenght problme on different databases [message #507097 is a reply to message #507093] Tue, 12 January 2010 07:53 Go to previous message
Dies Koper is currently offline Dies KoperFriend
Messages: 4
Registered: July 2009
Junior Member
I'm working on 2.0 and I had expected what I wrote to work on that version.
I don't know about 1.2 or other versions before 2.0; hopefully James can answer about that.
Previous Topic:EL 1.2 / Oracle10: Empty String automatically converted to a Whitespace
Next Topic:Problems with JPA 2, an Embeddable with Map and multiple usages in Entities
Goto Forum:
  


Current Time: Tue Mar 19 05:19:59 GMT 2024

Powered by FUDForum. Page generated in 0.02496 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top