[Rails] ActiveRecord and data integrity

Carl Youngblood carlwork at ycs.biz
Mon Nov 22 20:36:42 GMT 2004


Okay, this is a really basic question from a newbie to ActiveRecord.  
I've written nothing more than a small sample script testing it out.  
But I'm wondering a little bit about data integrity and race 
conditions.  My question is:  Is there anything in ActiveRecord that 
selects data and then runs inserts or updates based on information 
retrieved during select?  If so, does it put the full sequence of 
operations inside of a transaction?  What about for databases like MySQL 
with MyISAM tables, where transactions aren't possible?  With good 
design and an occasional LOCK TABLES, data integrity can be ensured, but 
I'm concerned that maybe ActiveRecord isn't doing this.

Thanks,
Carl Youngblood


More information about the Rails mailing list