Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Cascade.PERSIST marked List is not getting persited when Parent Object is persisted

Not exactly sure what you are doing,  could you please include your code for
your transaction.

In general you must read an object in the transaction context before
modifying it.



t3_chris wrote:
> 
> Hi!
> 
> I've got a strange Problem:
> 
> I have 3 Classes:
> 
> "Customer" contains a list of objects of type "Vendingmachine" and
> "Vendingmachine" contains a list objects of "VendingmachineEvent".
> 
> Vendingmachine within Customer is marked "cascade=CascadeType.ALL",
> "fetch=FetchType.LAZY"
> VendingmachineEvent within Vendingmachine is marked
> "cascade=CascadeType.ALL"
> 
> When i now add an Element to vendingmachine.lifecycleEvents by calling
> lifecycleEvents.add(x) (where x is a Object of type VendingmachineEvent)
> it doesn't get saved to the database when i call persist on Customer.
> 
> When in in contrast read all VendingmachineEvents before doing the persist
> the Events get persisted to the Database as expected.
> 
> That seems very strange to me! Why do i have to read out the elements to
> have them saved to the db?
> 
> Best regards,
> 
> christian
> 


-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/Cascade.PERSIST-marked-List-is-not-getting-persited-when-Parent-Object-is-persisted-tp22717289p22723842.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top