Glen/Gaurav,

I have done a fix where roller manages the relationship of the parent using
the entity manager refresh() method on the parent.  I was going to use
media manager methods to get the children, but it seems so reliant on the
entity relationships it would need considerable work to rewrite it.  The db
media file does not store the file path, only the parent id, so the queries
would always involve joining files.  .....Not really a fan of id's linking
stuff together, reminds me too much of the days of relative record numbers,
and just makes querying the database unpleasant.

If this way causes issues, I will go back and look at rewriting it.

Cheers Greg.


On 20 December 2013 22:56, Glen Mazza <glen.ma...@gmail.com> wrote:

> I don't have any objections, Gaurav's hands will be full enough with
> ROL-1981 so let him take a break from 1942 and Greg can go in and get done
> what he needs to get done.  (Gaurav this headache has been popping up
> multiple times in the past several months once we left Apache OpenJPA for
> Hibernate & Eclipselink.)
>
> Glen
>
> On 12/20/2013 08:51 AM, Greg Huber wrote:
>
>> Gaurav,
>>
>> Restarting the server flushes the cache inside eclipselink and hence next
>> time the list is retrieved (once server is restarted) it will get a new
>> copy the pojo with an new one to many relationship.  In hibernate you can
>> flush the cache with primary key and the pojo object class, but it becomes
>> a real pain as systems get more complicated to track where these flushes
>> are required.
>>
>> Its not really worth spending any time on this, the design needs
>> modifying,
>> which I could do if there are no objections.
>>
>> Cheers Greg.
>>
>>
>>
>>
>> On 20 December 2013 12:52, Gaurav <gauravsain...@gmail.com> wrote:
>>
>>  Hello,
>>>
>>>   I yesterday spent 2-3 hours on this issue ROL-1942 and tested it two
>>> three times, as mentioned in the bug we have to restart the server for
>>> getting the images, rather if we move any of the images then also that
>>> image appear in media view. The search is working fine and displaying the
>>> media files correctly. MediaFileView class make list of childFiles which
>>> is
>>> iterated in jsp. I was unable to track anything till now, as the search
>>> show correct results, I was wondering that can we use the same steps used
>>> to iterate list for search, although I am still working on this issue and
>>> debugging it by placing logs and studying the code for this, If anyone
>>> can
>>> give me some help or idea to go into this it will be very thankful ?
>>>
>>> Thanks
>>> Gaurav
>>>
>>> On Friday 20 December 2013 04:16 PM, Greg Huber wrote:
>>>
>>>  Glen,
>>>>
>>>> Looking more into this, its probably better to remove the associations
>>>> and
>>>> use a straight forward queries for the resources.  I have had trouble in
>>>> the past with these types of associations and they only work really for
>>>> lists that do not change.  If we ever want to use any sort of caching
>>>> (ie
>>>> on the parent pojo) these pojo's will need to be removed from the cache
>>>> on
>>>> each update, which can be a truly hair greying experience.
>>>>
>>>> If nobody has any obs probably just a few line fix,
>>>> hopefully it will get fixed as part of ROL-1942.  Please be patient (or
>>>> use Hibernate in the interim.)
>>>> jections I will replace the associations with queries.
>>>>
>>>> Cheers Greg.
>>>>
>>>>
>>>>
>>>> On 20 December 2013 00:55, Glen Mazza <glen.ma...@gmail.com> wrote:
>>>>
>>>>   Yes, I'm aware of the headache, it's probably just a few line fix,
>>>>
>>>>> hopefully it will get fixed as part of ROL-1942.  Please be patient (or
>>>>> use
>>>>> Hibernate in the interim.)
>>>>>
>>>>> Glen
>>>>>
>>>>> On 12/19/2013 07:02 AM, Greg Huber wrote:
>>>>>
>>>>>   Glen,
>>>>>
>>>>>> It looks like the crud (add/delete) on the media file child
>>>>>> association
>>>>>> is
>>>>>> not working again:
>>>>>>
>>>>>> MediaFileDirectory directory;
>>>>>> ..
>>>>>> this.childFiles.addAll(directory.getMediaFiles());
>>>>>>
>>>>>> what technique do we now have to use with eclipselink to successfully
>>>>>> flush
>>>>>> these associations?
>>>>>>
>>>>>> Cheers Greg.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>

Reply via email to