[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
| 
Re: [eclipselink-users] No OptimisticLocking Exception in combination	with ReturnInsert and/or ReturnUpdate
 | 
That sounds correct:
Without return after the first update the states of the object in the cache 
(Java app.) and in the db differ (because of the trigger);
with return however the db value created by the trigger is returned back to 
the Java app., therefore the states of object in the cache and the db are 
the same - hence no OptimisticLockException.
----- Original Message ----- 
From: <martin.berner@xxxxxxxxxxxx>
To: "EclipseLink User Discussions" <eclipselink-users@xxxxxxxxxxx>
Sent: Monday, August 10, 2009 4:23 AM
Subject: [eclipselink-users] No OptimisticLocking Exception in combination 
with ReturnInsert and/or ReturnUpdate
Hy,
I annotated an Entity with 
@OptimisticLocking(type=OptimisticLockingType.ALL_COLUMNS) to get an 
OptimisticLickingException in case of an Update with old Data. Database is 
Oracle 10g. We have fields on the Table which are Updated by Oracle Triggers 
on Update and Insert so I annotated dies Fields by @ReturnInsert and 
@ReturnUpdate:
   @Basic(optional = false)
   @Column(name = "UTILISATEUR", nullable = false, length = 10)
   @ReturnInsert
   @ReturnUpdate
   private String mutSign;
If I perform a Update on that Entity without ReturnInsert and ReturnUpdate, 
and try to perform another update on the same Entity I get an 
OptimisticLockingException because The Fields have changed per Trigger on 
the Database.
But with The Annotation of ReturnInsert and ReturnUpdate I didn't get an 
OptimisticLockingException even if there is one.
The only Thing I see in the Log is, that it assign null to the Fields 
annotated by ReturnInsert and ReturnUpdate by Returnvalue in case of old 
Data, bat no Exception.
In Fact the column wouldn't be updated, which is correct because of the 
generated WHERE - clause.
Is it a Problem combining  OptimisticLocking with ReturnInsert and/or 
ReturnUpdate or have I configured something wrong? Or is it fixed in a newer 
Version of EL (I'm Using EL 1.0.1 distributed by GlassfishV3prelude)
Thanks for any Help
Berner Martin
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users