Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Caching problem? when persisting a ManyToOne entity

as reply to Christopher:
You will note that the (only) if statements are in comments and should not
affect the test/problem nor the discussion here. As originally mentioned,
the comments were only included to show a workaround (general, thus the
if's)
As also originally mentioned, and demonstrated by the code, the Part *is*
added to the Bin's list.
A look at the code will show that addPartComplete IS the method being used.
Since the container is handling the transactions, it seems that bin is never
managed outside of the Facade file/class.
**NOTE**
Per your last sentence, I tried merging the bin and *not* persisting the
part, and all seems to work as originally expected, even if the Cascade is
removed from the @OneToMany in Bin, and even though the Part class is the
owning side of the relationship (isn't it??). This is surprising to me and
suggests that EclipseLink was implemented with the OneToMany side 'owning'
the relationship regardless of the spec's mention that use of mappedBy makes
the other side the owner. What am I missing/misunderstanding here?

*Restatement of the apparent issue: OneToMany side merge seems to take care
of 'related' ManyToOne side DB and cache changes, but ManyToOne side does
NOT seem to take care of OneToMany side cache (DB is not affected)
If efficient coding can not be done from the ManyToOne side using my
particular set of tools, I may just have to entirely rethink how I coded
this, to approach everything from the OneToMany side. Is there really no
choice here with EclipseLink? Is Hibernate better in this area? (ie
OneToMany side merge seems to take care of 'related' ManyToOne side DB and
cache, but ManyToOne side does NOT seem to take care of OneToMany side cache
(DB is not affected)
I would really appreciate it if someone can clear this(or me) up
definitively (no guesswork please).
Thank you in advance.



--
View this message in context: http://eclipse.1072660.n5.nabble.com/Caching-problem-when-persisting-a-ManyToOne-entity-tp154123p154136.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.


Back to the top