geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomasz Mazan <win...@wp.pl>
Subject Re: Cascade in JPA - problem
Date Thu, 22 Nov 2007 08:35:56 GMT

Jay
You're right that it's not JPA problem. I've forget that arguments are
passed "by value" if i use remote interface to my Dao beans. So, second
update/persist of my Account object tried to save also parent Customer
object treaten as _NEW_ because daoremote.save() method hasn't modify
original, remote reference.


Jay D. McHugh-2 wrote:
> 
> Tomasz,
> 
> It does not look like this is a JPA cascading problem.
> 
> It looks like your beans are trying to handle the inserts into your
> tables rather than letting JPA doing it.
> 
> You are getting 'duplicate key' exceptions on a number of prepared
> statements that are doing inserts.  With JPA - doing a persist (and then
> committing the transaction) will do the insert for you.
> 
> It is hard to track any farther without being able to see your code
> though.
> 
> Jay
> 
> Tomasz Mazan wrote:
>> Hello
>> 
>> I got two classes
>> 
>> @Entity
>> class Customer implements Serializable {
>> ...
>>  @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) 
>>  List<Account> accounts;
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Cascade-in-JPA---problem-tf4844549s134.html#a13892855
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message