java - How can prevent to save 2 same object in same time in my data base? and how I can test this version works correctly? -


we hava gate every vehicle submit card , reduce account.

some times when gate officer open tow tab , 2 exchange save in our data base , vehicleaccount reduce twice , 2 same accountexchange save in our data base .

please me know how can prevent save 2 same exchange in data base. how can test version works correctly ?

i use version in program :
@version private long version = 0l version doesnt increase when change accounts in ui . version remain 0 in condition . dont know why problem occure?

maybe save timestamp when writing database. everytime before change record can check if last change longer ago 10 seconds - or whatever time difference reasonable application.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -