-->
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.  [ 5 posts ] 
Author Message
 Post subject: Dont wanna update Version Number in certain situations
PostPosted: Wed Oct 26, 2005 4:31 pm 
Newbie

Joined: Thu Mar 17, 2005 8:15 pm
Posts: 19
Hi,
I implemented optimistic locking with version number. But Now I had a different requirement. Please go thru it.

I have order table, in which there is a coulmn called Deltek_Number.
User A--retrieves this order and start modifying it. (For him, deltekNumber is noneditable. infact, we dont show in the presentation tier)

User B--> retrieves Deltek Report ---> he can perform bulk update on orders for deltek number.

If user A tries to Update his order, naturally he will get optimistic locking exception. Client is asking us to avoid this problem in this situation.


Any pointers?

Thanks & Regards
Nagesh G

Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject: Re: Dont wanna update Version Number in certain situations
PostPosted: Wed Oct 26, 2005 4:45 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
nagmca wrote:
Hi,
I implemented optimistic locking with version number. But Now I had a different requirement. Please go thru it.

I have order table, in which there is a coulmn called Deltek_Number.
User A--retrieves this order and start modifying it. (For him, deltekNumber is noneditable. infact, we dont show in the presentation tier)

User B--> retrieves Deltek Report ---> he can perform bulk update on orders for deltek number.

If user A tries to Update his order, naturally he will get optimistic locking exception. Client is asking us to avoid this problem in this situation.


Any pointers?

Thanks & Regards
Nagesh G


What the Client is asking for makes no sense. If you don't update the Version, then when A updates the Order, you will OVERWRITE what B has done. That's what you're trying to avoid by using a Locking Strategy.

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


Top
 Profile  
 
 Post subject: Yep-
PostPosted: Wed Oct 26, 2005 4:53 pm 
Newbie

Joined: Thu Mar 17, 2005 8:15 pm
Posts: 19
Thats what I am trying to convince the client and that is the reason why we implemented optimistic locking.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 26, 2005 8:40 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
With Hibernate3, you could use a hql update statement to implement UserB performing "bulk update on orders for deltek number". By default these update statements do not increment the version number.


Top
 Profile  
 
 Post subject: Thank you
PostPosted: Wed Oct 26, 2005 8:43 pm 
Newbie

Joined: Thu Mar 17, 2005 8:15 pm
Posts: 19
Thank you.
Infact we didnt get that idea eventhough we are using bulk update in other places.
My mistake.

Thanks & regards
Nagesh G


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

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.