ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nguyen, Tom" <Tom.Ngu...@rels.info>
Subject RE: iBatis.Net - Optimistic concurrency control
Date Wed, 18 Apr 2007 18:04:20 GMT
Unless I'm behind on my knowledge, I don't believe that iBatis.Net has
automatic optimistic concurrency implementation.  You will have to
implement this yourself.

 

This is the pseudo of how I implemented mine:

BusinessBase<T> : IClonable

-Clone()

-OriginalObject AS T

 

Employee : BusinessBase<Employee>

-SSN

-FirstName

-LastName

 

1.	Retrieve Employee
2.	Clone Employee and store in OriginalObject
3.	Employee is parameter class of Update Ibatis Mapping

 

UPDATE dbo.Employee

SET FirstName = #_firstName#

            , LastName = #_lastName#

            , SSN = #_ssn#

WHERE FirstName = #OriginalObject._firstName#

            AND LastName = #OriginalObject._lastName#

            AND SSN = #OriginalObject._ssn#

 

 

Unless you have build some kind of framework to do this, it is a lot of
manual, repetitive work.  Only do it when you really need to.

 

Regards,


Tom Nguyen 
Sr. Developer
tom.nguyen@rels.info <mailto:tom.nguyen@rels.info> 



________________________________

From: Philippe Peuret [mailto:philippe.peuret@neoxia.com] 
Sent: Wednesday, April 18, 2007 7:20 AM
To: user-cs@ibatis.apache.org
Subject: TR: iBatis.Net - Optimistic concurrency control

 

Hello,

 

How to use the optimistic concurrency control when we update the
database with iBatis.Net ?

Because, when we use the <insert> or <update> elements, we can only pass
one parameter : the object to insert or to update. But there is no other
parameter to pass the data to the optimistic concurrency control.

 

Thank you for your help.


************************************************************************************
This e-mail message and any files transmitted herewith, are intended solely for the
use of the individual(s) addressed and may contain confidential, proprietary or 
privileged information.  If you are not the addressee indicated in this message 
(or responsible for delivery of this message to such person) you may not review, 
use, disclose or distribute this message or any files transmitted herewith.  If you 
receive this message in error, please contact the sender by reply e-mail and delete
this message and all copies of it from your system.
************************************************************************************

Mime
View raw message