views:

277

answers:

2

I loaded same entity record on 2 separate browser window then press submit (hibernate template.merge), version number incremented for both browser window, but never caught any problem with optimistic lock.. so how to test this?

my save() look like this

hibernatetemplate().merge(..);
setJPAObject(null); //reset after save
+1  A: 

Sure it's not 2 browser tabs (thus same session)? Can you post your controller code?

Michal Bachman
yes, u are right.
cometta
+1  A: 

Two separate browsers are better for testing this.

Priit