java - How to avoid concurrent access to payment link in my website -
i using mysql innodb , struts2 developing website. when user want use product, send invoice inbox , link can pay money.
the problem have solve is: when user opens link in 2 sessions , tries pay both, have allow 1 transaction. , if allowed transaction gets problem browser closure or other issue, things go deadlock condition. have avoid , allow next transactions.
please suggest me how achieve this?
i think have add life time each session prevent deadlocks (just in 1 being used bank's sites) , can using unique sessionids. sessions have fix life time. once time on session expired.
in case if 1 session active can deny attempts session. if browser closes in between session, session automatically expire after life time. if payment not done due reason i.e. session expire or browser closed, user can re-click on link , restart process.
hope helps,
Comments
Post a Comment