Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

concurrent issues

2937110Jan 8 2016 — edited Jan 8 2016

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


Comments

Processing

Post Details

Added on Jan 8 2016
0 comments
472 views