-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: concurrency management with a rich client
PostPosted: Wed Apr 13, 2005 8:43 am 
Newbie

Joined: Wed Apr 13, 2005 8:20 am
Posts: 2
Hi,

I am developing an application using Java POJO and Hibernate at the backend, and a rich client at the front end. Communication between backend and frontend will be XML-based through a servlet, and based on primitive values (integer ids, strings etc). It is not possible to store java objects natively on the client.

I am not interested in pessimistic locking, and currently using optimistic locking with hibernate managed versioning.

I think I have understood almost all the concept mentined in 8.2 Implementing Application Transactions of Hibernate in Action. However, I did not get the practical way of storing the detached instance in a user's session. In 8.2.3 of Hibernate in Action, "Suppose we kept the Item as a detached instance, storing it in the user’s HTTP session, for example. We could reuse it in the second database transaction by reassociating it with the new Hibernate session using either lock() or update()." OK, since I am implementing the session management myself, I can manage a session storage per user, but when to put and remove objects from there ?

A simple example, suppose we have an addressbook.
User is in a need to update a person's details.
As I understood from 8.2. a request for a need for updating the person must put that person object into somewhere (session storage) I can later find for version checking (reattaching to the session).
When I actually update the person, I must first reattach the person object I stored before, and update its fields, and try to save it, and see if everything goes fine, or not.
Will I remove it from session storage after I managed to save it successfully ?
Suppose I transfer all the addressbook data to rich client, it does not communicate until update actually occurs. So I do not know when to store which object into session storage.

I think I am a little confused. Any help is really welcomed...

Thanks in advance.

MB


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.