Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[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



Back to the top