-->
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: optimistic-lock="all" does not throw exception as expected
PostPosted: Thu May 31, 2012 9:27 am 
Newbie

Joined: Thu May 31, 2012 9:11 am
Posts: 1
I have defined a class, and set
Code:
dynamic-update="true" optimistic-lock="all" select-before-update="true"

in my xml file.
I start my program and load my data in displaying it in a datagridview.
Next i load up sql management studio, connect to the database, and alter an entry in the table i have just loaded in the program.
Over in the program I make sure the change has not propergated into the datagridview.
Now i change something in the row I had altered with sql management studio.
I save my change from the datagridview to the database.

What I expected was an exception in the program, but instead I find that the change i made with sql management studio has been overwritten completely with the other data from my program.

Can anyone take a stab at where I go wrong?
PS. just say and I'll post the code I use, if you need it.


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.