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
Post a Comment