Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » CLOB lenght problme on different databases
CLOB lenght problme on different databases [message #506367] Thu, 07 January 2010 00:25 Go to next message
Eclipse UserFriend
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 05:27] by Moderator

Re: CLOB lenght problme on different databases [message #506670 is a reply to message #506367] Fri, 08 January 2010 10:57 Go to previous messageGo to next message
Eclipse UserFriend
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] Sun, 10 January 2010 20:00 Go to previous messageGo to next message
Eclipse UserFriend
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 02:03 Go to previous messageGo to next message
Eclipse UserFriend
No, it doesn't.
Re: CLOB lenght problme on different databases [message #506976 is a reply to message #506367] Mon, 11 January 2010 10:28 Go to previous messageGo to next message
Eclipse UserFriend
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.

Re: CLOB lenght problme on different databases [message #507093 is a reply to message #506367] Tue, 12 January 2010 02:40 Go to previous messageGo to next message
Eclipse UserFriend
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 02:53 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 05:46:43 EDT 2025

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

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

Back to the top