Forum Stats

  • 3,733,041 Users
  • 2,246,686 Discussions
  • 7,856,490 Comments

Discussions

concurrent issues

2937110
2937110 Member Posts: 2

only one ticket available, 2 users are trying to the book the same ticket assume my db query is update availbeseats=availableseats-1 and bookseat=30 if 2 simultaneously requests ,it is wrong.

1. web application can be done with synchronized methods due to only one instance/object how to handle this in core java application?e

2.if we use jdbc isolation level serialization (it will avoid dirty read etc),is it enough?

3.we can't handle this with transactions,is it? transaction said to be all operations by the same user has to be done or not. but 2 users concurrent requests , how transactions helpful to us?

4. different frameworks will provide solution for this in different ways.can u explain me with simple examples,if possible?

5.to solve this kind of problems,what is the need of synchronized methods? as i read transactions will handle db update without any issues even for concurrent requests also


Sign In or Register to comment.