openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "seth.jackson" <seth.jackson....@dfas.mil>
Subject Re: openjpa 1.2.2 - Optimistic Lock Exception
Date Fri, 02 Apr 2010 14:21:35 GMT

Apparently the @JoinTable is creating SQL similar to the following:

SELECT t0.*
FROM PROOF.ACCOUNTS t0,
PROOF.ACTIVITY t1,
PROOF.ACTIVITY t2
WHERE t0.ACCOUNT_ID = t1.ACCOUNT_ID (+)
AND t1.ACCOUNT_ID = t2.ACCOUNT_ID

Why openJPA is creating a join to the same table twice is beyond me. I
believe this is why I'm getting the OptimisticLockException.


So, I modified the annotations to the following:

@OneToMany(fetch=FetchType.EAGER,cascade=CascadeType.ALL,targetEntity=Activity.class)
@JoinColumn(name="ACCOUNT_ID", referencedColumnName="ACCOUNT_ID")
private Set<Activity> activities = new HashSet<Activity>();

Then I get the infamous: "You have supplied columns for ... but this mapping
cannot have columns in this context."

I think my relationship annotations are inaccurate. Still getting burned
here.


-----
Seth Jackson
-- 
View this message in context: http://n2.nabble.com/openjpa-1-2-2-Optimistic-Lock-Exception-tp4842528p4842849.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message