Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exists
[Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exists [message #1053742] Tue, 07 May 2013 13:07 Go to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Hi,

We're creating a RCP application and we use EMF resources to load our data. We're in need of calling an Oracle stored procedure to modify our data. After the procedure we want to refresh one single object, but that causes some problems.

This is our simplified model:

- Folder
-- documents : Document (opposite: folder)

- Document
-- folder : Folder (opposite: documents)

Our procedure deletes a document from the database so we want to refresh our folder. I expected the documents reference to update automatically, but instead it tries to load the deleted object. This is the error we get:

org.hibernate.UnresolvableObjectException: No row with the given identifier exists: [Document#1161401]
	at org.hibernate.UnresolvableObjectException.throwIfNull(UnresolvableObjectException.java:64)
	at org.hibernate.event.internal.DefaultRefreshEventListener.onRefresh(DefaultRefreshEventListener.java:159)
	at org.hibernate.internal.SessionImpl.fireRefresh(SessionImpl.java:1044)
	at org.hibernate.internal.SessionImpl.refresh(SessionImpl.java:1029)
	at org.hibernate.engine.spi.CascadingAction$3.cascade(CascadingAction.java:205)
	at org.hibernate.engine.internal.Cascade.cascadeToOne(Cascade.java:380)
	at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:323)
	at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:208)
	at org.hibernate.engine.internal.Cascade.cascadeCollectionElements(Cascade.java:409)
	at org.hibernate.engine.internal.Cascade.cascadeCollection(Cascade.java:350)
	at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:326)
	at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:208)
	at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)
	at org.hibernate.event.internal.DefaultRefreshEventListener.onRefresh(DefaultRefreshEventListener.java:123)
	at org.hibernate.event.internal.DefaultRefreshEventListener.onRefresh(DefaultRefreshEventListener.java:64)
	at org.hibernate.internal.SessionImpl.fireRefresh(SessionImpl.java:1036)
	at org.hibernate.internal.SessionImpl.refresh(SessionImpl.java:1013)
	at org.hibernate.internal.SessionImpl.refresh(SessionImpl.java:1008)


This is the code we execute after the procedure:

session.refresh(folder);


On this forum I read the not-found="ignore" prevents the error from happening but I can't set this because I use the EOpposite...

Does anyone know how to solve this?

Thanks in advance!
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1053755 is a reply to message #1053742] Tue, 07 May 2013 13:56 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
I finally found how to achieve the not-found="ignore" functionality, doing:

@NotFound(action=NotFoundAction.IGNORE)


But this solves part of the problem.. now it complains for every reference inside the document.. So it ignores the document, but it tries to refresh the references of it. That doesn't make sense.. Should the ignore be set on every reference?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1053776 is a reply to message #1053755] Tue, 07 May 2013 14:36 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Replying on my own post again..

When setting PersistenceOptions.CASCADE_POLICY_ON_NON_CONTAINMENT to 'PERSIST' instead of 'MERGE, PERSIST, REFRESH' it works.

Now I only have to find out what effect this has on my application..
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1053849 is a reply to message #1053776] Tue, 07 May 2013 21:14 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5332
Registered: July 2009
Senior Member
Hi Ricky,
This cascade setting means that the merge and refresh actions are not cascaded to the referenced objects. Depending on
what the stored procedure changes this may or may not be a good idea...

Btw, you can also iterate/walk over the object graph yourselve to do refresh explicitly if you want it to be cascaded.

gr. Martin

On 05/07/2013 04:36 PM, Ricky de Klerck wrote:
> Replying on my own post again..
>
> When setting PersistenceOptions.CASCADE_POLICY_ON_NON_CONTAINMENT to 'PERSIST' instead of 'MERGE, PERSIST, REFRESH' it
> works.
> Now I only have to find out what effect this has on my application..


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1053940 is a reply to message #1053849] Wed, 08 May 2013 07:38 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do want the refresh/merge I need to set the @NotFound in every reference below my Document? Because the refresh will produce an error when something is deleted?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1053941 is a reply to message #1053849] Wed, 08 May 2013 07:39 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do need the refresh/merge I have to set the @NotFound in every reference below my Document? Otherwise it produces an error when refreshing after a Document is deleted
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1053956 is a reply to message #1053849] Wed, 08 May 2013 07:38 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do want the refresh/merge I need to set the @NotFound in every reference below my Document? Because the refresh will produce an error when something is deleted?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1053957 is a reply to message #1053849] Wed, 08 May 2013 07:39 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do need the refresh/merge I have to set the @NotFound in every reference below my Document? Otherwise it produces an error when refreshing after a Document is deleted
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1053978 is a reply to message #1053849] Wed, 08 May 2013 07:38 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do want the refresh/merge I need to set the @NotFound in every reference below my Document? Because the refresh will produce an error when something is deleted?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1053979 is a reply to message #1053849] Wed, 08 May 2013 07:39 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do need the refresh/merge I have to set the @NotFound in every reference below my Document? Otherwise it produces an error when refreshing after a Document is deleted
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054002 is a reply to message #1053849] Wed, 08 May 2013 07:38 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do want the refresh/merge I need to set the @NotFound in every reference below my Document? Because the refresh will produce an error when something is deleted?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054003 is a reply to message #1053849] Wed, 08 May 2013 07:39 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do need the refresh/merge I have to set the @NotFound in every reference below my Document? Otherwise it produces an error when refreshing after a Document is deleted
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054026 is a reply to message #1053849] Wed, 08 May 2013 07:38 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do want the refresh/merge I need to set the @NotFound in every reference below my Document? Because the refresh will produce an error when something is deleted?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054027 is a reply to message #1053849] Wed, 08 May 2013 07:39 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do need the refresh/merge I have to set the @NotFound in every reference below my Document? Otherwise it produces an error when refreshing after a Document is deleted
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054055 is a reply to message #1053849] Wed, 08 May 2013 07:38 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do want the refresh/merge I need to set the @NotFound in every reference below my Document? Because the refresh will produce an error when something is deleted?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054056 is a reply to message #1053849] Wed, 08 May 2013 07:39 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do need the refresh/merge I have to set the @NotFound in every reference below my Document? Otherwise it produces an error when refreshing after a Document is deleted
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054084 is a reply to message #1053849] Wed, 08 May 2013 07:38 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do want the refresh/merge I need to set the @NotFound in every reference below my Document? Because the refresh will produce an error when something is deleted?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054085 is a reply to message #1053849] Wed, 08 May 2013 07:39 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do need the refresh/merge I have to set the @NotFound in every reference below my Document? Otherwise it produces an error when refreshing after a Document is deleted
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054114 is a reply to message #1053849] Wed, 08 May 2013 07:38 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do want the refresh/merge I need to set the @NotFound in every reference below my Document? Because the refresh will produce an error when something is deleted?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054115 is a reply to message #1053849] Wed, 08 May 2013 07:39 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do need the refresh/merge I have to set the @NotFound in every reference below my Document? Otherwise it produces an error when refreshing after a Document is deleted
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054145 is a reply to message #1053849] Wed, 08 May 2013 07:38 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do want the refresh/merge I need to set the @NotFound in every reference below my Document? Because the refresh will produce an error when something is deleted?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054146 is a reply to message #1053849] Wed, 08 May 2013 07:39 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do need the refresh/merge I have to set the @NotFound in every reference below my Document? Otherwise it produces an error when refreshing after a Document is deleted
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054179 is a reply to message #1053849] Wed, 08 May 2013 07:38 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do want the refresh/merge I need to set the @NotFound in every reference below my Document? Because the refresh will produce an error when something is deleted?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054180 is a reply to message #1053849] Wed, 08 May 2013 07:39 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do need the refresh/merge I have to set the @NotFound in every reference below my Document? Otherwise it produces an error when refreshing after a Document is deleted
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054216 is a reply to message #1053849] Wed, 08 May 2013 07:38 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do want the refresh/merge I need to set the @NotFound in every reference below my Document? Because the refresh will produce an error when something is deleted?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054217 is a reply to message #1053849] Wed, 08 May 2013 07:39 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do need the refresh/merge I have to set the @NotFound in every reference below my Document? Otherwise it produces an error when refreshing after a Document is deleted
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054254 is a reply to message #1053849] Wed, 08 May 2013 07:38 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do want the refresh/merge I need to set the @NotFound in every reference below my Document? Because the refresh will produce an error when something is deleted?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054255 is a reply to message #1053849] Wed, 08 May 2013 07:39 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do need the refresh/merge I have to set the @NotFound in every reference below my Document? Otherwise it produces an error when refreshing after a Document is deleted
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054291 is a reply to message #1053849] Wed, 08 May 2013 07:38 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do want the refresh/merge I need to set the @NotFound in every reference below my Document? Because the refresh will produce an error when something is deleted?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054292 is a reply to message #1053849] Wed, 08 May 2013 07:39 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do need the refresh/merge I have to set the @NotFound in every reference below my Document? Otherwise it produces an error when refreshing after a Document is deleted
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054330 is a reply to message #1053849] Wed, 08 May 2013 07:38 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do want the refresh/merge I need to set the @NotFound in every reference below my Document? Because the refresh will produce an error when something is deleted?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054331 is a reply to message #1053849] Wed, 08 May 2013 07:39 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do need the refresh/merge I have to set the @NotFound in every reference below my Document? Otherwise it produces an error when refreshing after a Document is deleted
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054370 is a reply to message #1053849] Wed, 08 May 2013 07:38 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do want the refresh/merge I need to set the @NotFound in every reference below my Document? Because the refresh will produce an error when something is deleted?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054371 is a reply to message #1053849] Wed, 08 May 2013 07:39 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do need the refresh/merge I have to set the @NotFound in every reference below my Document? Otherwise it produces an error when refreshing after a Document is deleted
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054410 is a reply to message #1053849] Wed, 08 May 2013 07:38 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do want the refresh/merge I need to set the @NotFound in every reference below my Document? Because the refresh will produce an error when something is deleted?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054411 is a reply to message #1053849] Wed, 08 May 2013 07:39 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do need the refresh/merge I have to set the @NotFound in every reference below my Document? Otherwise it produces an error when refreshing after a Document is deleted
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054450 is a reply to message #1053849] Wed, 08 May 2013 07:38 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do want the refresh/merge I need to set the @NotFound in every reference below my Document? Because the refresh will produce an error when something is deleted?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054451 is a reply to message #1053849] Wed, 08 May 2013 07:39 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do need the refresh/merge I have to set the @NotFound in every reference below my Document? Otherwise it produces an error when refreshing after a Document is deleted
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054491 is a reply to message #1053849] Wed, 08 May 2013 07:38 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do want the refresh/merge I need to set the @NotFound in every reference below my Document? Because the refresh will produce an error when something is deleted?
Re: [Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exi [message #1054492 is a reply to message #1053849] Wed, 08 May 2013 07:39 Go to previous messageGo to previous message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Ok, but when I do need the refresh/merge I have to set the @NotFound in every reference below my Document? Otherwise it produces an error when refreshing after a Document is deleted
Previous Topic:Mixed feature delegation across type hierarchy/genmodels
Next Topic:[EMF] Choose internally used EList (sets which use '==' or 'equals')
Goto Forum:
  


Current Time: Fri Sep 19 22:10:51 GMT 2014

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

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