Optimistic locking in vaadin and mysql db -


the vaadin book says can set column optimistic locking follows:

tq.setversioncolumn("optlock");

however says that:

tablequery assumes database take care of updating version column either using actual version column (if supported database in question) or trigger or similar mechanism

how take care of updating version column in database?

any appreciated

if using jpa or implementation should able annotate beans with:

@version private long version; 

so every time persist bean version number increased 1 automatically. in case bean has lower/different version number during persisting means changed in meantime , jpa throws optimistic locking exception.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -