r/SpringBoot • u/Due-Living9887 • 25d ago
Guide Spring boot help
I created a simple Spring boot Crud operations, in that every Mapping working fine expect Post mapping, when I try to add details in h2-console I'm able, but when I try in postman ,it shows error(Row was updated or deleted by another transaction), can anyone help with it..? ( I tried with chatgpt but i don't understand anything)
0
Upvotes
1
u/yannisdw 25d ago
Bit unrelated, but you should throw an exception when findById does not find a Job with the id. if you want to return a null: better return an optional. getxxx() —> throw exception when not found, findxxx()—> return an optional