• 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 can we know the Data Table fields changed for every 5mints

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks


I have Strange requirement, I have to work on recordLocking functionality,

When User1 is lock the request and editing the request, Administrator can unlock the request and edit the same request, whenever admin unlocak the request user1 has to get a promt saying that Admin has locked your request , You can't further proceed the same request.

Could any one please come up with one trigger in java to find out whenever the table "REQUEST" fields "lockby" and "lockedtime" changes to null we have to get promt ..? Is there any provision in Struts or JDBC




ThanksInadavance
Madhav
 
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
If this is a web app, then a trigger is probably not the way to go. Web apps are request driven, so even if the data changes there is no way to push that change out a client.

From a web app, your only real route would be to poll the table to watch for changes. You could do this in the background using AJAX.

That aside, if this were my task, I'd ask the person who set it to explain why pessimistic locking is required in a web app in the first place. Its usually considered bad practice; web apps and RBDMSs are by their nature designed to support multiple concurrent users. Once you add pessimistic locking to the mix that behaviour goes. A better way might be some sort of weighted optimistic locking pattern, where those users in the admin role "win" when there is a version mismatch?
 
saivenu madhav
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul for your Quick response,

Could you please help in both ways of doing

1)weighted optimistic locking pattern
2)background using AJAX.



ThanksInadavance
Madhav
 
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
Sure. What do you need to know?
 
saivenu madhav
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you please help on optimstic way of RecordLocking.


and AJAX way also if possible


Regards
Madhav
 
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
Yes I can help. What specifically would you like to know?

Are you familiar with the term "optimistic locking"? If you are not, this will get you going. Are you familiar with the term AJAX? If not, this should give you some background.
 
saivenu madhav
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul,

Thanks for your reply, I need an example of code for both Optimestic Locking & Ajax way doing,


Could you please give some sample code or basic architecture.


ThanksInadavance
Madhav
 
reply
    Bookmark Topic Watch Topic
  • New Topic