• 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

Long Locking Transaction's

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to have a
WLS-based transaction that spans
multiple requests in a Web Based application ?
If yes how can this be Iplemented ?
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is typically done through the use of Stateful Session Beans.

From EJB 2.0 Specification
A stateful Session Bean instance may, but is not required to, commit a started transaction before a business method returns. If a transaction has not been completed by the end of a business method, the Container retains the association between the transaction and the instance across multiple client calls until the instance eventually completes the transaction.


In most cases it is undesirable to have transactions span multiple client calls as it tends to negatively affect scalibility.
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And if the client browser doesn't come back to make the full series of requests, you lock up a database connection until the session bean times out.
A bad idea.
Better to collect all the user input (like in HTTPSesssion) and submit it to the database on the final "submit" request.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx Chris & Dave but what I wanted to know
was if a client A browses some data on a site ,
intending to update it and then takes a longer
period of time by which time the Data in the store is updated by another client B.
Now if client A updates the same data , B's changes are lost or we have a BURIED UPDATE .
I know we could apply optimistic locking techniques like a Time stamp etc to get over this problem ...but is there a way to lock the data involved in the transaction across HTTP request's ???
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic