• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to implement Concurrent access to records..Please help me URGENTLY

 
Ranch Hand
Posts: 603
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I have a scenario as below
Please help me out to implement this ;-)

-------------------
Scenario
-------------------
1> 2 users are accessing a single record (in a web based J2EE App) at the same time
2> 1 user should be able to see one of the records in READ ONLY MODE and the other user in WRITE ONLY MODE

Assuming 1st user access's 1st Record hence RECORD1.WRITE_ONLY_MODE -- EDITABLE

Assuming 2nd user access's 1st Record hence should be RECORD1.READ_ONLY_MODE -- NON EDITABLE

3> When the 1st user is accessing the 1st record,He enters the details of the 1st record,and clicks on "save button",The data gets saved to the db.
;When the 2nd user access the 1st record at the same instance of time,he should be displayed with a message saying " RECORD IS LOCKED BY ANOTHER USER,Trying Accessing After Sometime"

5>The 1st user after saving the data for 1st record comes out of the record profile.now if the 2nd user tries to "REFRESH" The Jsp page and tries to access the same 1st RECORD ,He should be displayed with the message "RECORD IS AVAILABLE FOR CHANGES."


How do i go about in implementing this in a J2EE Web based application.

IN CASE IF U KNOW THE IMPLEMENTATION LOGIC.PLEASE PROVIDE THE SAME
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please read the important administrative private message I am sending you in a minute or two.

Don't go round saying things are urgent.
 
Deepak Lal
Ranch Hand
Posts: 603
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Campbell,
Is my displayed name now correct??
Guys please help me around with this query....
 
Author
Posts: 3473
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What persistence framework are you using? Hibernate, JDBC, etc. Read up on the database isolation levels and ACID properties. If you are using Hibernate, you can use its optimistic locking strategy. Also have a look at "select for update ...."
[ September 20, 2008: Message edited by: arulk pillai ]
 
Deepak Lal
Ranch Hand
Posts: 603
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi arulk pillai
Assume its a simple J2EE web based application built using jsp's and servlets,

How would you implement Concurrent access feature to records.??
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think what this interview/assignment question is trying to get you to talk about is locking strategies. In which case arulk pillai has already mentioned one, and hinted at another. I'd have a google for them and see what you learn, or alternatively try searching this forum.
 
Deepak Lal
Ranch Hand
Posts: 603
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
I'm unable to get any information ,Please help me.
Deepak lal
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by arulk pillai:
What persistence framework are you using? Hibernate, JDBC, etc. Read up on the database isolation levels and ACID properties. If you are using Hibernate, you can use its optimistic locking strategy. Also have a look at "select for update ...."

[ September 20, 2008: Message edited by: arulk pillai ]



Have a google for the highlighted terms.
[ September 22, 2008: Message edited by: Paul Sturrock ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic