Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Refresh entity doesnt work with relationships
Refresh entity doesnt work with relationships [message #1021189] Tue, 19 March 2013 16:24 Go to next message
Wilber Saca is currently offline Wilber SacaFriend
Messages: 2
Registered: March 2013
Junior Member
Hello, my first thread in this forum, I have a big problem. for example my entities:

class Entity1 {Long Id, String name, Collection<Entity2> entity2Collection}
class Entity2 {Long Id, String name}

when I find for Entity1 list in the DB, entity2Collection(changed by a trigger when I update Entity1) is not refreshed. I have tried with "javax.persistence.cache.storeMode", "eclipselink.refresh", "eclipselink.refresh.cascade", etc.

I need resolve this, I'm using the v2.3.2. any help or reference? Thanks...
Re: Refresh entity doesnt work with relationships [message #1027038 is a reply to message #1021189] Tue, 26 March 2013 13:52 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

If you want to update something using a trigger and have it show up in JPA you need to refresh the object, or disable the shared cache.

i.e.
em.refresh(object)

See,
http://wiki.eclipse.org/EclipseLink/FAQ/How_to_disable_the_shared_cache%3F

http://wiki.eclipse.org/EclipseLink/Examples/JPA/Caching#How_to_refresh_the_cache


James : Wiki : Book : Blog : Twitter
Re: Refresh entity doesnt work with relationships [message #1027966 is a reply to message #1027038] Wed, 27 March 2013 16:52 Go to previous message
Wilber Saca is currently offline Wilber SacaFriend
Messages: 2
Registered: March 2013
Junior Member
Then, no one alternative to refresh automatically the collection when I refresh the entity? cascade is set for ALL...

[Updated on: Wed, 27 March 2013 16:56]

Report message to a moderator

Previous Topic:Custom Insert/Update/Delete (Virsioning)
Next Topic:How to persist a class which extends List<>?
Goto Forum:
  


Current Time: Thu Apr 25 07:49:13 GMT 2024

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

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

Back to the top