asp.net - SQL Insert NOT always creating row in table -
i have aspx.vb program checks table see if session exists , if not connects our ecm software, consumes license, , updates table sessions information. if user tries log in again should find existing session , still consume 1 license.
this works 99% of time except user consume 2 licenses creates 1 row in table, in turn leaves duplicate session caught in limbo , has manually disconnected release license.
i added logging , hitting code should , variables passing correct values. possible code running through logic fast before connection can established database?
lvsql = "insert onbase_sessions values (@dbseqnum,@sid,@uname,@lastactivity,@ccseqnum)" x = new sqlcmds(lvsql, "onbaseapi") x.addintparameter("@dbseqnum", sqldbtype.int, 4, lvdatasourceseq) x.addstrparameter("@sid", sqldbtype.varchar, 40, lvsession) x.addstrparameter("@uname", sqldbtype.varchar, 15, user.username) x.addstrparameter("@lastactivity", sqldbtype.datetime, 0, system.datetime.now) x.addintparameter("@ccseqnum", sqldbtype.int, 4, lvclientcodeseq) x.exenonquery()
learned valuable lesson on importance of using private on public variable. :p
Comments
Post a Comment