Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » @AdditionalCriteria breaks on @LOB updates
@AdditionalCriteria breaks on @LOB updates [message #1080695] Tue, 06 August 2013 05:18 Go to next message
Eclipse UserFriend
I have set @AdditionalCriteria for soft delete over all my @Entity objects.

The soft-delete column is a Boolean in model with a converter from "Y" "N" value in DB (oracle).

@AdditionalCriteria("this.deleted = false") works most of the time and gets mapped to deleted = 'N'

When I try to write lob's I can see that it inserts deleted = 0 instead of the proper value hence I am supposing Eclipselink is not doing the correct mapping whenever you do operations on entities with attributes stored as LOB's. AT least that is the pattern I have observed so far.

I am using 2.4.2 which is also the latest version by date, any chance this is working as intended in 2.5? I know I can file a bug, but this project will be due long before I get it fixed either by myself or by someone else... any recommendations? Besides doing it manually, I know about that one.

Regards

[Updated on: Tue, 06 August 2013 05:18] by Moderator

Re: @AdditionalCriteria breaks on @LOB updates [message #1082403 is a reply to message #1080695] Thu, 08 August 2013 10:21 Go to previous messageGo to next message
Eclipse UserFriend
AdditionalCriteria is used on reads, not writes, how are you setting the deleted when writing?

Perhaps include the class and SQL that does not work.
Re: @AdditionalCriteria breaks on @LOB updates [message #1083133 is a reply to message #1082403] Fri, 09 August 2013 10:15 Go to previous messageGo to next message
Eclipse UserFriend
I think the problem is simple. To update a LOB via jdbc you typically use a stream. So you select like this:
select lob from table where criteria for update;

Then you write in that lob stream you got from the select.

Problem is Eclipselink applied @additionalcriteria in that query (so much I gleaned from simple logs). The query above shouldn't be filtered as you said. But filtering itself was not the major problem, problem was that the filter on the query above had its value mapped in a default fashion, not in the way I specified in the converter (as happens in normal update). I guess eclipselink 2.5 could solve this via its new api for converters and if that gets called always on mapping... but I have other problems with eclipselink 2.5 and I've posted another post about that.

Anyway, I will hopefully be able to make a small working reproduction of this bug in a few weeks, currently my schedule is full to bursting.
Re: @AdditionalCriteria breaks on @LOB updates [message #1085864 is a reply to message #1080695] Tue, 13 August 2013 09:28 Go to previous message
Eclipse UserFriend
The LOB locator is not required on Oracle anymore if you are using Oracle 11 or up. Try setting your target-database to Oracle11.

It seems like a bug with the additional criteria being applied to the locator query, please log the bug.
Previous Topic:Eclipselink 2.5 on Glassfish 3.1.2.2 possible without JavaEE7?
Next Topic:JPA selecting, what should be lazy loaded, when not necessary
Goto Forum:
  


Current Time: Wed Jul 02 19:57:00 EDT 2025

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

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

Back to the top