Re: One-to-Many ordered list not ordered when cached

View: New views
1 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: One-to-Many ordered list not ordered when cached

by Tim Bruton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Chris,

Thank you very much for your solution. This fixed my cache issue.

Regards, Tim.

-----Original Message-----
From: eclipselink-users-bounces@...
[mailto:eclipselink-users-bounces@...] On Behalf Of
eclipselink-users-request@...
Sent: Sunday, 6 July 2008 2:00 AM
To: eclipselink-users@...
Subject: eclipselink-users Digest, Vol 11, Issue 4

Send eclipselink-users mailing list submissions to
        eclipselink-users@...

To subscribe or unsubscribe via the World Wide Web, visit
        https://dev.eclipse.org/mailman/listinfo/eclipselink-users
or, via email, send a message with subject or body 'help' to
        eclipselink-users-request@...

You can reach the person managing the list at
        eclipselink-users-owner@...

When replying, please edit your Subject line so it is more specific
than "Re: Contents of eclipselink-users digest..."


Today's Topics:

   1. Re: One-to-Many ordered list not ordered when cached
      (christopher delahunt)


----------------------------------------------------------------------

Message: 1
Date: Fri, 04 Jul 2008 14:22:56 -0400
From: christopher delahunt <christopher.delahunt@...>
Subject: Re: [eclipselink-users] One-to-Many ordered list not ordered
        when cached
To: EclipseLink User Discussions <eclipselink-users@...>
Message-ID: <486E6A80.2090204@...>
Content-Type: text/plain; charset=windows-1252; format=flowed

Hello Tim,

Only the OrderedListContainerPolicy EclipseLink container policy will
attempt to maintain order when merging into the cache.
To use it, try: ((CollectionMapping)mapping).setContainerPolicy( new
OrderedListContainerPolicy(concreteContainerClass) );
This requires that you use a List implementation (such as Vector) for
your container class.

Best Regards,
Chris

Tim Bruton wrote:

>
> Hi all,
>
> I have a one to many mapping where the many objects should be sorted
> by a query key.
>
> In my Eclipselink workbench I have set the Advanced Container Options
> to List and java.util.ArrayList.
>
> The descriptor of my "many objects" calls an After Load method that
> sets useTransparentCollection() and addAscendingOrdering( "listSeqNo"
).

>
> I have a unit test that creates several instances of the "many
> objects" and they are created with ascending values on the query key
> (called "listSeqNo") as expected.
>
> The unit test then commits the transaction and a subsequent unit test
> then uses the objects, however the items are retrieved from the cache
> and are no longer in sorted order.
>
> If I later retrieve the same items from the database via a query the
> items are retrieved in correct order.
>
> I can not find a way to configure the cache to obey the ordering as
> dictated by the query key.
>
> I have tried removing the addAscendingOrdering() from my After Load
> method and setting it in the workbench on the one-to-many mapping
> (Ordering tab), but this did not help.
>
> I have tried not using a transparent collection (in the After Load
> method), but this did not help.
>
> I tried several combinations in the Advanced Container Options without

> success, although I have not tried the TreeSet, since it is not
> trivial to update our code.
>
> This is a new problem since migrating from Toplink 2.5.1 (ouch). I
> have tried everything I can think of to try to get this working.
>
> I am using eclipselink-incubation-1.0M9, Java 1.5 and Oracle 9i.
>
> I have found some similar issues but am not sure if they are the same
> cause, e.g.
>
> http://forums.oracle.com/forums/thread.jspa?messageID=2571698
>
> Please help with suggestions or information.
>
> Regards Tim.
>
>
------------------------------------------------------------------------
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@...
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>  


------------------------------

_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


End of eclipselink-users Digest, Vol 11, Issue 4
************************************************
_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users