Hello, Anish : Connor is 101% right, is Natural and Expected that multiple database sessions acessing the same row WILL block - in Oracle RDBMS data consistency is PARAMOUNT, so no two sessions can change the same data at the same time , AND (obeying the RDBMS rules) each database session CAN and WILL 'see' only THEIR changes in the data....
IF what you want with threads is to 'break' a large work into multiple tasks/processes, PARALLEL SQL is the answer for it : with PARALLEL SQL the RDBMS will Automagically divide the work into multiple 'slave works'.... Ok ? And, if due to any reason you don´t have access to native Parallel SQL, use the poorman´s/DIY options, such as DBMS_PARALLEL....
It´s NOT RECCOMENDED, but Another option, if you REALLY WANT to 'break to work' in Java threads, Externally (OUT of the database) would be make the multiple java threads share one database session : read the Database JDBC Developer's Guide (right now online in
https://docs.oracle.com/database/121/JJDBC/apxtips.htm#JJDBC28948 ) and see that you CAN have multiple threads sharing one database session...
OF COURSE, the manual ALSO warns you againt doing it (I repeat, PARALLEL SQL inside the database is the prefered way) but afaik it is possible...
Finally, if you want/need to have multiple threads in Java (urgh!), AND due to any issue you MUST/WANT create a dedicated database session to each thread, is up to you CONTROL the multiple sessions to avoid two sessions acessing/changing teh same data at the same time...
And yes : no SELECT FOR UPDATE inside views, think in other options if you really want/need to use views...
Regards,
J. Laurindo Chiappa