6 hours 56 minutes ago · Public
i have a problem in mysql ,someone please help me!
i want to generate enroll no . which are increment in group wise inst_id. every new institute have to start enroll from 1. if institute has multiple branches than problem generate.
if we fetch max enroll no then increment 1 then insert , that time if 2 branch fetch same max id on same time , after increment they both send same enroll no. on server . that's a big conflict two enroll no. are same.
now i have to put exclusive lock their, but i don't know what's the exact query for exclusive lock? please help me .