cometta
cometta

Reputation: 35689

jpa @version optimistic locking

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

Upvotes: 2

Views: 1902

Answers (2)

Priit
Priit

Reputation: 480

Two separate browsers are better for testing this.

Upvotes: 1

Michal Bachman
Michal Bachman

Reputation: 2661

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

Upvotes: 3

Related Questions